Redirect to Specific Page Based on Referring Domain

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
gsownsby
-


Joined: 03 Jun 2003
Posts: 71
Location: Chattanooga, TN USA

PostPosted: Thu Aug 23, 2007 12:58 am    Post subject: Redirect to Specific Page Based on Referring Domain Reply with quote

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 View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Thu Aug 23, 2007 8:26 am    Post subject: Re: Redirect to Specific Page Based on Referring Domain Reply with quote

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 View user's profile Send private message Visit poster's website
gsownsby
-


Joined: 03 Jun 2003
Posts: 71
Location: Chattanooga, TN USA

PostPosted: Thu Aug 23, 2007 8:52 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Thu Aug 23, 2007 9:00 pm    Post subject: Reply with quote

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 View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group