Jul 11, 2011

How do I prevent hotlinking of images?

You can prevent gif, jpeg, png files (and any other file formats you choose) from being hotlinked in other websites is to use a few mod_rewrite rules in your .htaccess file.

1. RewriteEngine on
2. RewriteCond %{HTTP_REFERER} !^$
3. RewriteCond %{HTTP_REFERER} !^http://([-a-z0-9]+\.)?powervps\.com [NC]
4. RewriteRule \.(gif|jpe?g|png)$ - [F,NC,L]

0 comments:

Post a Comment

 

Copyright © 2011 Best WebHosting Tips | Design by Kenga Ads-template