Caps problem with mod_rewrite

New to mod_rewrite? This is a good place to start.

Caps problem with mod_rewrite

Postby nuLime » Sat Jul 24, 2004 8:04 am

We have the following in our .htaccess file to prevent hot linking of images:
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?our-site\.com/.*$ [NC]
RewriteRule .*\.(gif|jpg|png|jp2)$ http://www.out-site.com/no_hot_linking.gif [F,NC]


This works great in Mozilla based browsers regardless of the way the URL is capitalized. However, Internet Explorer can't fetch the images if the caps are different in the base domain name.

For instance, if a visitor types in "www.our-site.com" in IE, all of the images show up. However, if they type "www.Our-Site.com", all of the images show as empty boxes with a red X. This problem doesn't manifest with Mozilla based browsers.

I even tried adding the line

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?Our-Site\.com/.*$ [NC]

before the RewriteRule but the problem remains.

What is wrong here?

I'm using Apache 1.3.31.

Thanks in advance!
nuLime
 
Posts: 1
Joined: Sat Jul 24, 2004 8:02 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 37 guests

cron