PDA

View Full Version : htaccess restricted image


Ddr
6-23-02, 06:22 PM
I know there was a thread about this not too long ago, but couldn't find it, sorry.

I can get .htaccess to stop gif and jpg file hotlinking, but I am unable to get the restricted.bmp image to show in place of a broken link on the remote site. I made the restricted image a bmp, because the rule restricts transfer of jpg and gif images. I can hotlink directly to the restricted.bmp image with no problem. I just cant get .htaccess to make this happen automatically.

My pics are labeled correctly, everything is lower case, spelled correctly, uploaded to the right places and with the right format. The .htaccess file looks like this:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://dale.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.dale.com/ [NC]
RewriteRule [^/]+.(gif|jpg)$ http://www.dale.com/springbash/images/restricted.bmp [R,L]

BTW, www.dale.com if fictitious. Sorry, but I dont want anyone going into this site at the moment. I know it makes it more difficult to troubleshoot, but I need to do this this way. Can anyone spot a problem with the code? Thanks in advance


Dale

one48am
6-23-02, 06:32 PM
Sorry I can't be of much help, but the 404 access error was giving me a lot of trouble a few days ago. I had to use the tutorial found in the FAQ rather than the one at help.powweb.com to get it to work. The FAQ, in this case, directs you to the following URL:

http://forum.powweb.com/showthread.php?s=&threadid=613

I hope that helps.

Also, if you have frontpage extensions enabled, I think it'll cause problems with the .htaccess file

Ddr
6-23-02, 07:23 PM
Thanks 1:48am. I looked back at that thread (it was one I contributed to, btw) and there was one interesting thing there...a link to www.hotlinking.com.

I tried to hotlink using my addie in their little test window and got the broken link as expected. There was a "comfirmation" test on the results page that said to double check,click your link again here. I did that, and to my surprise, in the pop-up window, I did get my restricted.bmp. Go figure? Some places it shows, some it doesn't. Anyone have any thoughts?


Thanks

Dale