Forum Moderators: phranque

Message Too Old, No Replies

How to test for no HTTP_REFERER with mod_rewrite?

         

Philosopher

10:10 pm on Mar 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So I know how to test for a specific referer, but how do I test for NO referer at all?

Also, I'm basically wanting to test for whether the requesting visitor belongs to 1 of 2 different IP addresses or has no referer, if so, do a rewrite.

So far I have

RewriteCond %{REMOTE_ADDR} 255.255.255.255 [OR]
RewriteCond %{REMOTE_ADDR} 255.255.255.255 [OR]
RewriteCond %{HTTP_REFERER}

I don't mess with mod_rewrite too often, so please let me know if I've left something out of the rewrite cond so far (other than the rest of the http_referer test.)

Thanks

jdMorgan

1:35 am on Mar 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




# Blank Referrer
RewriteCond %{HTTP_REFERER} ^$

I've posted about the topic of blank referrers many times here, so I'll just repeat the simple version: Be aware that many legitimate visitors are behind corporate and ISP caching proxies that effectively suppress the referrer header. An example would be all AOL users.

Also, some of these visitors will be on machines running Norton Internet Security and similar; Their referrer info may be suppressed without their knowledge.

Jim