PDA

View Full Version : Hotlink Protection, Stop others linking to your images.


nicholas
01-02-2004, 05:29 PM
Make a plain text file called

.htaccess

add this to you new file

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?your_domain.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]


Upload the file to the directory you wish to protect your images

Permissions only need to be 644

don't forget to change your_domain.com to the name of your actual domain name.

Do the same with this one for mp3 and such files

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?your_domain.com/.*$ [NC]
RewriteRule \.(mp3|ogg|mpg)$ - [F]