Hotlinking protection using .htaccess won't work

Fix it!!

Postby richardk » Sat Oct 13, 2007 3:26 pm

It is strange, try
Code: Select all
RewriteCond %{HTTP_REFERER} ^(http://(www\.)?africapic\.com(/.*)?)?$ [NC]
RewriteRule \.jpg$ - [NC,L]
RewriteRule \.jpg$ - [NC,F,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby blindlemon1983 » Mon Oct 15, 2007 1:32 am

I almost gave up there. OK, so its still not working even though I flush the browser's cache before checking. However, a friend reported that an image isn't displaying for him where the HTTP_REFERER is Africapic.com and the folder is WebLinks (the one folder I wanted to come up). The same photo comes up fine my side.
blindlemon1983
 
Posts: 8
Joined: Fri Sep 14, 2007 11:56 am

Moving away from Mod Rewrite

Postby blindlemon1983 » Mon Oct 15, 2007 6:13 am

Still not working so I'm moving away from modrewrite to the php alternative.
Basically a php script can return an image so you can have the src attribute of an image as a php script and have that script query a database for the correct image path. So my code will look like this to those who view the source:
Code: Select all
<img src="http://www.africapic.com/WebLinks/displayimage.php?1082" />
. The script is availible at http://www.it-guru.co.uk/showthread.php?t=121 for any who're interested. Hope it works how I want it to....
blindlemon1983
 
Posts: 8
Joined: Fri Sep 14, 2007 11:56 am

Previous

Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 17 guests

cron