Posts Tagged mod_rewrite

htaccess block access by referer

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.

, ,

No Comments

htaccess rewrite rule

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

, ,

No Comments