Shoutbox

htacces help [solved] - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: htacces help [solved] (/showthread.php?tid=38768)

htacces help [solved] by Ezra on 02-18-2005 at 09:06 PM

I had a 404 error page for my website that worked, but now i'm trying to add hotlink protection but that fails, and now i get error 500 pages :-S

code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(www\.)?tsdme\.nl/ [NC
RewriteCond %{HTTP_REFERER} !^$
RewriteRule \.(jpe?g|gif|bmp|png)$ images/nohotlink.jpg [L]
ErrorDocument 404 /error404.htm

Does anyone know what i'm doing wrong?

nevermind i already fixed it :-D

code:
ErrorDocument 404 /error404.htm
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?tsdme.nl(/)?.*$     [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.tsdme.nl/images/nohotlink.jpg [R,NC]

It still doesn't work :-S, I don't have those 500 errors anymore, but the hotlink protection doesn't work properly :(
RE: htacces help by WDZ on 02-19-2005 at 04:42 AM

Try adding this right before the RewriteRule line...

RewriteCond %{REQUEST_URI} !images/nohotlink.jpg$ [NC]

It seems that your current code is creating an infinite loop. When someone is redirected to nohotlink.jpg, the hotlink protection is applied again for that image. And again and again and again and again...... :p

The line above should stop the hotlink protection from applying to nohotlink.jpg.


RE: htacces help by Ezra on 02-19-2005 at 03:46 PM

It works, thanks you very much :-D