rewrite serving the same picture but to only a few people

Fix it!!

rewrite serving the same picture but to only a few people

Postby jcloth » Mon Apr 05, 2004 3:08 pm

I'm having an issue of some people (very minor number) complaining that on my site, all they see is the 'shemale' pic that I return in my rewrite to hotlinkers.


This is the rewrite:
--------------------------------
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} !^http://(.*)bashtard.com/(.*)? [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*)picturepile.com/(.*)? [NC]
RewriteRule ^file_upload/upload/.*$ file_upload/upload/1061147873_jenniferbasque093.jpg$1 [L]

--------------------------------

Basically, if you try to hotlink or view images directly without going through the comment system you get 'shemaled'.

This works for 99% of people and I hear no complaints, but there seems to be that 1% of people who have this issue and I can't figure out why.


This is the HTTP_USER_AGENT that didn't work this time:
--------------------------------
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts)
--------------------------------

Scanning the log, this user appears to be coming from a Cable Internet connection. That is the only thing I can think of that might be the issue on their end with the Cable forced proxy setup.

These are other HTTP_USER_AGENT that work fine:
--------------------------------
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; .NET CLR 1.1.4322)
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4)

--------------------------------

The server is:
Linux w/ Apache 1.3.29 / PHP 4.3.4


Has anyone ever come across this were only a select few people can't access your site because you rewrite keeps sending them the same image?
jcloth
 
Posts: 2
Joined: Mon Apr 05, 2004 2:38 pm

Postby Caterham » Sat Dec 11, 2004 3:00 am

It's not about the user agent but about the referer it sends (or the proxy-server deletes). So, what is the Referer when s.o. visits yout site with Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts)?

if the referer is missing/empty, use

Code: Select all
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(.*)bashtard.com/(.*)? [NC]
RewriteCond %{HTTP_REFERER} !^http://(.*)picturepile.com/(.*)? [NC]
RewriteRule ^file_upload/upload/.*$ file_upload/upload/1061147873_jenniferbasque093.jpg$1 [L]
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Security with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 8 guests

cron