Forum Moderators: phranque

Message Too Old, No Replies

htaccess Redirect based on Referer

         

skaiwayne

1:24 am on Feb 24, 2005 (gmt 0)



Someone is forwarding an adult content domain to my domain. Using htaccess how do I detect the referer domain and redirect visitors to a page on my site denying the referer domain?

jdMorgan

2:59 pm on Feb 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



skaiwayne,

Welcome to WebmasterWorld!

The simplest method would be to use RewriteCond testing %{HTTP_REFERER} and responding with a 403-Forbidden if the domain matches your undesired referrer. See RewriteCond and RewriteRule in Apache mod_rewrite. Links to these and other useful resources are available in our forum charter [webmasterworld.com].

Jim