Welcome, Guest. [ Log In ]
Question   How do I stop "hotlinking" to my files?
Search KBase

Top 5 in this Area:
1. How do I use .htaccess files?
2. How can I turn off the default directory listing in a directory?
3. How do I block people coming from a certain website or URL from visiting my site or directory?
4. Can I use .htaccess files?
5. How do I stop "hotlinking" to my files?

How do I stop "hotlinking" to my files?
"Hotlinking" is when somebody displays an image (or any type of file actually) on somebody else's web site directly inline on their site!

There's nothing particularly wrong with that, it's a big part of how the WWW was designed to work. However, it does "steal" the bandwidth of the original site, and could possibly infringe on a copyright.

To block sites from hotlinking to specific files of yours, you just need to make a .htaccess file with certain commands in it! Here's a great page with a more detailed explanation, but basically the file should look more or less like this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com.*$     [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.yourdomain.com/stophotlinking.html [R,NC]

Last updated: Feb 25, 2004.

User Post (2004-10-14 21:01:31 by kdzhao)
Please note: if you are doing so on your subdomain, use subdomain name instead.