Log in

View Full Version : .htaccess and hotlinking


bashy
06-29-2006, 04:55 PM
Hi peeps

Whats the info i need to add to my .htaccess file to prevent hotlinking please

Guest210212002
06-29-2006, 07:06 PM
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpe?g|png|bmp)$ [F,NC]


To have it show an image.


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule \.(gif|jpe?g|png|bmp)$ /images/whatever.gif [L,NC]

bashy
06-29-2006, 07:31 PM
Thanks Chris, can i add movies to this should i need to?
e.g. RewriteRule \.(gif|jpe?g|png|bmp|mpg|avi|mpeg)$ /images/whatever.gif [L,NC]

Guest210212002
06-30-2006, 03:31 PM
I've actually never tried it with movies, but that should work, yep. :)