Forum Moderators: phranque

Message Too Old, No Replies

Hotlink protection problem

         

Munkee

4:34 pm on Jan 4, 2004 (gmt 0)



Heres what i have in my .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mydomain\.net/ [NC]
RewriteRule \.(jpe?g¦gif¦bmp¦png¦JPE?G)$ - [F]

and seems to be working fine. but the problem is i have a file "index.php" that when someone first comes to the site, it pulls a random splash page from the folder "mydomain.net/splash". But the pics on those pages are not coming up now. what should i add so that pages in the "splash" folder are allowed to display my images?

Thank U

jdMorgan

3:27 am on Jan 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Munkee,

Welcome to WebmasterWorld [webmasterworld.com]!

It's possible that your php page is not providing a referrer. Referers are notoriously unreliable anyway, and I always suggest allowing blank referers due to the fact that many caching proxies and internet security software packages suppress the referer info. So, it looks like you've run into another case where the referrer is suppressed.

To fix it, you can try this:


RewriteEngine On
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain\.net/ [NC]
RewriteRule \.(jpe?g¦gif¦bmp¦png)$ - [NC,F]

The [NC] flag on the RewriteRule makes the pattern comparison case-insensitive, so you don't need "JPE?G" in the pattern anymore.

Jim