.htaccess to stop hotlink

Stop bandwith thief using rewrite rules on .htaccess file

Annoyed! when some people hotlink your files/images and not giving link-back to your site, They run their own ads code using your bandwidth. I think this is not allowed! at least they should giving link-back not just stolen our bandwidth without anything like that. Would you give them some psycho attack? Then you’re on right page keep continue reading on this article.

If you want people back to your site you should make an code to stop hotlink files and give warning message on it… like my very easy sample 😛


I made an warning message in some of my site to stop hotlink, photoshop images are good but I prefer html/flash files with click action script so when people click on it it will redirect to your own site.

Once you make your own warning message time to edit .htaccess files and put this code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?YOURSITE.com [NC]
RewriteRule \.(swf|jpg|gif|etc)$ hotlink.jpg [NC,L]
Read More »Stop bandwith thief using rewrite rules on .htaccess file