PDA

View Full Version : .htaccess hotlink question


TwinTone
03-10-2002, 11:10 AM
I am trying to setup a .htaccess for a customer of mine. He runs a "picture voting" site and is having issues with hotlinkers. So I am trying to get this to work, but the script pulls the pictures that are being voted on by the URL so in a sense I am protecting him from himself. Is there a way to make the pictures show on his site, but not linked to by other sites? This is what I have in the .htaccess now and it is causing broken images on his site.<br /><br />RewriteEngine on<br />RewriteCond %{HTTP_REFERER} !^$<br />RewriteCond %{HTTP_REFERER} !^http://www.vote4her.com/vote/pics/.*$ [NC]<br />RewriteCond %{HTTP_REFERER} !^http://vote4her.com/vote/pics/.*$ [NC]<br />RewriteRule ^.*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ <a href="http://www.yahoo.com" target="_blank">http://www.yahoo.com</a><br /><br />Thanks in advance..

Brian911
03-10-2002, 11:12 AM
not sure but maybe try just the domain without any path..<br /><br />I just grabbed one of mine:<br />AuthUserFile /dev/null<br />AuthGroupFile /dev/null <br /><br />RewriteEngine On<br />RewriteCond %{HTTP_REFERER} !^http://www.domain.com [NC]<br />RewriteCond %{HTTP_REFERER} !^http://domain.com [NC]<br />RewriteRule /* <a href="http://www.domain.com" target="_blank">http://www.domain.com</a> [R,L] <br /><br />of course you have to make it works just with images.. I think the basic structure is right

TwinTone
03-10-2002, 11:31 AM
Nope. I changed it to this, and they show up on his page now, but can also be hotlinked. This is what is in the .htaccess file now.<br /><br />AuthUserFile /dev/null<br />AuthGroupFile /dev/null<br /><br />RewriteEngine on<br />RewriteCond %{HTTP_REFERER} !^$<br />RewriteCond %{HTTP_REFERER} !^http://www.vote4her.com/.*$ [NC]<br />RewriteCond %{HTTP_REFERER} !^http://vote4her.com/.*$ [NC]<br />RewriteRule ^.*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ <a href="http://www.yahoo.com" target="_blank">http://www.yahoo.com</a><br /><br />Thanks for the help though..

TwinTone
03-10-2002, 11:34 AM
I guess I left out that the .htaccess file is located in the original pic directory. Part of the issue is, he has a folder of pictures he uses for pic post sites, so all I want to do is protect that one directory, not the whole site. But at the same time, I want him to be able to call the pictures from that pic directory on to his root page. Maybe its not possible.. I have never come across this situation before.<br /><br />Thanks

Nymph
03-10-2002, 01:09 PM
Try this one...<br /><br />AuthUserFile /dev/null <br />AuthGroupFile /dev/null <br /><br />RewriteEngine on<br />RewriteOptions inherit <br />RewriteCond %{HTTP_REFERER} !^$ <br />RewriteCond %{HTTP_REFERER} !^http://www.vote4her.com [NC]<br />RewriteCond %{HTTP_REFERER} !^http://vote4her.com [NC] <br />Rewriterule .*[Jj][Pp][Gg]$|.*[Gg][Ii][Ff]$ <a href="http://www.yahoo.com" target="_blank">http://www.yahoo.com</a><br /><br />It works on all of mine anyways <img border="0" title="" alt="[Smile]" src="smile.gif" />

TwinTone
03-10-2002, 01:42 PM
Well, lets see if it works.. heh<br /><br /> <img src="http://vote4her.com/vote/pics/img3c6c38c652a8a.jpg" alt="" />

TwinTone
03-10-2002, 02:07 PM
Guess not.. <img border="0" alt="[Repuke]" title="" src="graemlins/repuke.gif" />

TwinTone
03-10-2002, 02:08 PM
Very odd.. I guess it does.. just to awhile.<br /><br />Thanks for the help! <img border="0" title="" alt="[Smile]" src="smile.gif" />

TwinTone
03-10-2002, 02:10 PM
grrrrrrr.. need edit on this board..<br /><br />Just took awhile..

Due
03-10-2002, 02:14 PM
Anyone know where to find a good picture vote script like that?<br />Can't seem to find them anywhere <img border="0" title="" alt="[Frown]" src="frown.gif" />