Posts Tagged mod_rewrite
htaccess block access by referer
Posted by Wil in htaccess tutorials on June 27, 2009
If your server is over – spammed, this .htaccess configuration will help you. By blocking website access by referrer you are disabling any impressions that come from “wrong” referrer. It could be “bad” bot that uses your website resources in it’s needs. You can block “bad” bots or urls from visiting your website by editing .htaccess file :
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_REFERER} botsite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} othersite\.com [NC,OR]
RewriteRule .* – [F]
</ifModule>
Domains marked in bold are wrong referrer domains, and we don’t want any traffic from.
Modify your .htaccess file and add “wrong” bots or referrers to disable resources stealing.
htaccess rewrite rule
Posted by Wil in htaccess tutorials on June 27, 2009
To enable rewrite rule and rewrite commands you will need to enable apache rewrite engine.
Add this code to your .htaccess to enable rewrite commands of your server :
RewriteEngine on