Warning: session_start(): open(/tmp/session/sess_jqhqta3or90j4ss5psbt16js5s, O_RDWR) failed: No such file or directory (2) in /www/wwwroot/new_blog/webpage/index.php on line 8

Warning: session_start(): Failed to read session data: files (path: /tmp/session) in /www/wwwroot/new_blog/webpage/index.php on line 8
做了泛域名解析了如何禁止非指定域名访问_涂鸦绘画网 - 一个走在web开发路上的爱好者个人博客

您现在的位置是:首页 >学习教程 > 做了泛域名解析了如何禁止非指定域名访问网站首页学习教程

做了泛域名解析了如何禁止非指定域名访问

2022-04-11 17:01:306642人围观
简介做了泛域名解析了如何禁止非指定域名访问

在我们做了泛域名解析以后,往往想限制非指定域名不能访问的时候,应该如何实现呢?
下面是讲如何利用.htaccess禁止非指定域名访问站点


    RewriteEngine On
    RewriteBase /
    #禁止非法域名访问.返回404错误页面. power by cefhost
    #-判断规则,若有多个域名则写多条.(除了以下域名,其他均不允许访问)
    rewritecond %{http_host} !^chinmo.net$ [nc]
    rewritecond %{http_host} !^www.chinmo.net$ [nc]
    #-禁止规则
    rewriterule ^.* - [F,L]

文章评论