如果访问者来自某些通过 .htaccess (Apache) 的引用者,我会尝试阻止他们。
在网络上的多个地方找到了此代码和变体,但它似乎阻止了所有流量,而不仅仅是引用域:
# block visitors referred from indicated domains
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} sweetfreestuff.com [NC,OR]
RewriteCond %{HTTP_REFERER} wormhole.com [NC,OR]
RewriteRule .* - [F]
</ifModule>
也尝试过这种变化,没有变化:
# block visitors referred from indicated domains
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} sweetfreestuff\.com [NC,OR]
RewriteCond %{HTTP_REFERER} wormhole\.com [NC,OR]
RewriteRule .* - [F]
</ifModule>