Forum Moderators: phranque

Message Too Old, No Replies

hot linking code stopped working

         

brokenbricks

7:15 pm on Oct 17, 2005 (gmt 0)

10+ Year Member



I've been using the following code succesfully to stop people hotlinking my images. It has been working for awhile and today I noticed hotlinked images are showing up on the thieves sites. What changed? I dont know. Is there something wrong in the code? Did my host change something?

RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?site.com(/)?.*$ [NC]
RewriteRule .*\.(gif¦jpg¦jpeg¦bmp)$ [site.com...] [R,NC]

Thank you

Note: there is a space on the first 2 lines after } and the pipes are solid.

jdMorgan

7:23 pm on Oct 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How did you determine that the images were showing again?

Did you flush your browser cache before visiting each of those hotlinking sites?

If not, then your browser will display the images it has cached from your visits to your own site, instead of re-fetching them when referred from the hotlinking site. In this case, your browser will not send the image requests to your server, so your code can have no effect. Always flush your cache before testing.

When testing your code, look at your raw server access logs. You will clearly see the image accesses if your browser does request them, and whether your server response is 200-OK or 403-Forbidden.

If you still have a problem, then contact your host; code doesn't stop working without a reason.

Jim