![]() |
|
Customer Support
How do I stop other websites from using my bandwidth
while they steal images, flash, etc. from my site?
It is possible for other websites to serve your content to their visitors by linking to your objects from their webpages. For example, www.badsite.com might have some html on their site like That would make it so that for every visitor to badsite.com, yoursite.com would serve an image. This image would be out of context from your website, and the badsite.com visitor would never know the image was coming from yoursite.com and would not visit yoursite.com. This is also known as "hotlinking".
The reason it is bad, aside from theft of copyright, is because those visitors from badsite.com are using up yoursite.com's bandwidth allowance. If there is enough traffic at badsite.com, then yoursite.com could end up being charged a lot of money for bandwidth usage that went to the benefit of badsite.com.
This type of bandwidth theft can happen with any media type (zip, pdf, swf, wav, mov, mp3, etc.), not just images.
There are several things you can do to prevent people from hotlinking to your property, and using your bandwidth, to serve their visitors at some other website.
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com [NC]
RewriteRule .*.(gif|jpg|swf|png)$ - [NC,F]
The above should be on 5 separate unbroken lines (even though the lines may have wrapped in your browser window) where each newline begins "Rewrite....", and you need to replace "yoursite.com"
with the domain name of your own website.
RewriteEngine On
RewriteCond %{HTTP_REFERER} badsite.com [OR,NC]
RewriteCond %{HTTP_REFERER} otherbadsite.com [OR,NC]
RewriteCond %{HTTP_REFERER} thirdbadsite.com [NC]
RewriteRule .*.(gif|jpg|swf|png)$ - [NC,F]
The above should be on 5 separate unbroken lines (even though the lines may have wrapped in your browser window) where each newline begins "Rewrite...."
Also, in both of the above examples, you could also change filename extensions (gif, jpg, swf) to other file extensions, or add other extensions to the list (like mp3, zip) as appropriate.
RewriteRule .*.(gif|jpg)$ http://yoursite.com/bad.gif [R,NC]
all on 1 unbroken line.
Then, if badsite.com was stealing a GIF or JPEG from you, visitors of badsite.com will see bad.gif (which could be an image that says "This site steals images") instead of any other file that ended in .gif or .jpg. Doing this will still cost you bandwidth since you will continue to serve objects for the other site, just not the ones they wanted.
User-Contributed Notes |
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
Related Questions:
Why does my website just say "Error 403 Forbidden"?
How do I protect a directory with .htaccess?
How can I show a default page other than index.html?
How do I stop people from getting directory listings when I dont have an index page?
What do the different HTTP Status Codes like 200, 304, 404, 401, 403 mean?
What options are configured with Apache and what can I do with .htaccess files?
How do I protect a directory with mod_auth_mysql?
Which Apache modules are installed?
How do I make my own Error Documents to replace the default ones like
404 Not Found?How can I make apache recognize different MIME types?
The webservers' Gzip compression is messing up my XML or Flash files for Netscape 4 browsers. How do I turn off compression?
How do I get different character sets to display correctly?
What webserver do you run?
Will I have access to raw logfiles?
I created a symbolic link, and now I am getting a 404 errors.
How do I stop the server from automatically correcting spelling mistakes in URLs or offering multiple choices for documents?
My mod_rewrite rules make my website stop loading.
Why am I getting a 412 Precondition Failed from a website?
How do I protect my website from comment spam?
How do I enforce the use of SSL on my website?
How do I redirect traffic to another web page?
Browse Categories:Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales |

