View previous topic :: View next topic |
Author |
Message |
gsownsby -
Joined: 03 Jun 2003 Posts: 71 Location: Chattanooga, TN USA
|
Posted: Thu Aug 23, 2007 12:58 am Post subject: Redirect to Specific Page Based on Referring Domain |
|
|
How does one set up a redirect based on the referring domain? If a website visitor comes from abc.com, I want to redirect them to a certain web page. If the visitor comes from any other domain, I would send them to a different (default) web page? Thanks. |
|
Back to top |
|
|
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Thu Aug 23, 2007 8:26 am Post subject: Re: Redirect to Specific Page Based on Referring Domain |
|
|
gsownsby wrote: | How does one set up a redirect based on the referring domain? If a website visitor comes from abc.com, I want to redirect them to a certain web page. If the visitor comes from any other domain, I would send them to a different (default) web page? Thanks. |
Abyss Web Server X2 does this. Its called Virtual Hosts.
You could also try using the VHC script for Abyss Web Server X1 but it is limited in functionality. X2 would provide a better longterm solution. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
|
gsownsby -
Joined: 03 Jun 2003 Posts: 71 Location: Chattanooga, TN USA
|
Posted: Thu Aug 23, 2007 8:52 pm Post subject: |
|
|
Perhaps I didn't define what I need enough...
If any ComCast.net user comes to my website I want to route them to a specific web page. If any AOL.com user comes to my website, I want to route them to a different web page.
I'm not talking about hosting multiple websites on the same Abyss web server. Thank you. |
|
Back to top |
|
|
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Thu Aug 23, 2007 9:00 pm Post subject: |
|
|
Ah I see. You would have to find out their reverse DNS names, example for AOL would probably just be aol.com in the reverse DNS name. Based on that you can use a basic php script to redirect to the appropriate page.
pseudo code:
Code: | $rdns = functiontogetrdns();
if($rdns contains "aol.com"){
header("Location: aol.html");
} |
I can't remember the exact functions for getting the rDNS and the "contains" bit off hand but I have used them both before and I can almost guarantee it will work.
By the way is there any particular reason you are doing this? Maybe there is a simpler solution? _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
|
|