.htaccess阻止所有其他域名

时间:2014-04-10 14:45:49

标签: .htaccess security

我在互联网上搜索了很多内容,但我没有找到任何解决问题的方法。我想阻止从我的服务器包括来自所有域或ip的文件,除了我自己的。我真的希望你能帮助我。

1 个答案:

答案 0 :(得分:0)

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_REFERER} !^http://www\.your_domain_name\.com/ [NC]
RewriteRule ^.*$ http://www.your_domain_name.com/not_allowed_here.htm [R=301,L]