【问题标题】:Block specific URL from hitting your site阻止特定 URL 访问您的网站
【发布时间】:2012-01-24 19:42:18
【问题描述】:

所有, 我的网站从反向链接获得了大量流量,这影响了我的谷歌分析。有没有办法阻止特定网站通过 .htaccess 访问我的网站?例如,如果我想阻止 http://foo.com 我该怎么做?还有比 .htaccess 更好的方法吗?

提前致谢!

【问题讨论】:

  • “屏蔽网站”是什么意思?您的意思是阻止来自该引荐网站的所有访问?
  • @AndrewMarshall 是的,我就是这个意思。

标签: .htaccess hyperlink http-referer


【解决方案1】:

尝试将以下内容添加到您的 .htaccess 文件中

#if the request came from foo.com
RewriteCond %{HTTP_REFERER} ^http://foo\.com$
#then serve it a 403 Forbidden
RewriteRule . - [F,L]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-01
    相关资源
    最近更新 更多