"Hotlinking" refers to another Web site linking directly to a file (usually
a graphic) on your Web site. This steals your bandwidth which causes a
heavier load on your server. If you've ever gone through your site logs and
found someone hotlinking to your image files, then you need to add the
following lines in your .htaccess file. Be sure to change "yourdomain.com"
to your actual domain name. IMPORTANT! Before doing any of this, you need to
find out from your Web host if your server supports "mod_rewrite". If it
does not, this tip won't help you.
[Formatting Note: There should be a total of four (4) lines of code. Each
one must be on its own line, without being wrapped.]
--- begin code ---
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ - [F,NC]
--- end code ---
These rewrite rules basically say that if the request for a gif,jpg,jpeg or bmp was not from your server, report the file as not found.
Additional resources:
Module mod_rewrite URL Rewriting Engine
http://nl.internet.com/ct.html?rtr=on&s=1,1che,1,ebsm,fc8c,jzqg,lsbv
Preventing Bandwidth Theft Using the Mod Rewrite Engine and .htaccess
http://nl.internet.com/ct.html?rtr=on&s=1,1che,1,epjj,fh4h,jzqg,lsbv
Monday, January 24, 2005
Subscribe to:
Post Comments (Atom)
Popular Posts
- Yahoo! Mail: Revenge of the Oddpost
- MobileTracker - Cingular announces EDGE Wireless WAN service
- Linux Forum: Apache, Webmin and Mandrake - Linux Operating System Help
- Free AS400 & iSeries Software Tools & Utilities Downloads
- Common Gateway Interface (CGI) on the as400 / iSeries
- Table designs based on CSS and DIV elements
- The Laughing Boardroom video...a real world example!
- UDATE and *DATE in AS400 RPG
- IBM eServer iSeries - The Laughing Boardroom
- Does Anybody Care About AIX on the iSeries?
No comments:
Post a Comment