Forum Moderators: phranque

Message Too Old, No Replies

htaccess referer based redirection

how to do it?

         

vasiapup

10:47 am on May 3, 2005 (gmt 0)

10+ Year Member



The main page is [subdomain.domain.com...]
I need all visitors coming to [subdomain.domain.com...] from www.onesite.com and www.anothersite.com to be redirected to [domain.com...] but visitors coming from any other sites should see [subdomain.domain.com...]
What should I write in my .htaccess file?
subdomain.domain.com and domain.com are in different folders on my server so their .htaccess files don't interfere or override each other.
Thanks in advance.

jd01

8:55 am on May 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi vasiapup,

Sorry for the delay in responding... We usually help with code that already exists, so sometimes general questions get missed.

You can do what you are asking through the use of a RewriteCondition. The site search has not been woring lately, so if you use one of the major search engines and search for RewriteCond {HTTP_REFERER} site:webmasterworld.com you should find a plethora of information relating to exactly what you need.

When you have something that is close, post that either here or in a new thread and one of us will help walk you through 'tweeking' it to your specific need.

Hope this helps.

Justin

jdMorgan

4:39 pm on May 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



vasiapup,

Welcome to WebmasterWorld!

A second search for "HTTP_REFERER unreliable [google.com]" may lead you to some other information that you should be aware of.

Jim