Disallow hotlinking while allowing requests from robots.txt and favicons

We all hate Leechers. Here’s how to stop them in their tracks from stealing your images and your bandwidth!

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !(^/robots\.txt|\.ico)$
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|pdf)$ [F,L]

Tags: ,

Leave a Reply