1

Topic: htaccess?

How do I prevent the naughty users from stealing the avatar links. I'm running Apache so the easiest way doing this would be using .htaccess.

But, I'm not a genius so I could use some help smile
Thanks smile

Religion is the result of a mans imagination.

2 (edited by Falconey 2004-10-08 13:08)

Re: htaccess?

Try this one:

Options All -Indexes

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp|png)$ http://www.google.com [R,NC]

Change the line containing domain.com to your domain name

Edit: Change the last line containing google.com to http://www.yourdomain.com/hotlink-warning.gif. This way you can replace the hotlinked image to another (nasty?) one.

Re: htaccess?

Also note that if you don't get the right behaviour you might have go at the back of the last line and press ENTER and then save the .htaccess file.
I had this problem bugging me for quite some time before I found the solution.