Force “www” in domain and prevent hotlinking and bandwidth stealing from your website

In your .htaccess file, replace “prolificfutility.com” with your own website.

The second set of rewrite conditions will allow search engines to crawl your site but redirect other requests from external sites to a single image or feel free to redirect them to another site!


<IfModule mod_rewrite.c>

#  Force www in website address
RewriteCond %{HTTP_HOST} ^prolificfutility.com
RewriteRule (.*) http://www.prolificfutility.com/\ [R=301,L]

# Prevent hotlinking and bandwidth stealing:
RewriteCond %{HTTP_REFERER} !^http://([^.]+.)?prolificfutility.com[NC]
RewriteCond %{HTTP_REFERER} !google. [NC]
RewriteCond %{HTTP_REFERER} !search?q=cache [NC]
RewriteCond %{HTTP_REFERER} !msn. [NC]
RewriteCond %{HTTP_REFERER} !yahoo. [NC]
RewriteCond %{REQUEST_URI} !^/hotlink.gif$

RewriteRule .(gif|jpg|png)$ /hotlink.gif [NC,L]

</IfModule>

 

Leave a Reply 0

Your email address will not be published. Required fields are marked *