Menu


How to prevent hotlinking

Hotlinking is a term used for the linking of an image from a site by another site. The linking site steals bandwidth this way from the linked site.

To prevent this, create or edit the .htaccess file and place the following code in the file

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?example\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /dontsteal.jpg [L]


Please remember to:

  1. replace example.com from line 2 with your sitename
  2. replace dontsteal.jpg from line 4 with your image (this image will be displayed if hotlinking occurs)






Apache categories


Apache Installation? | Apache Configuration | Apache Troubleshooting?

Back to > Software




Google Search

 
www.lacisoft.com
WWW
2009-2011 (c) Lacisoft.com