I am a php newbie and am trying to write a script that will direct visitors to specific pages on my website based on which of several url’s they have entered (all are aliases of the main website).
While all visitor will be directed to the same website, I want visitors to start at specific pages based on their interests, rather than having to drill down from various menus.
For example, let us call the main domain abc.com.
I have the following domains which are being used as aliases:
abcfurniture.com
abcbooks.com
abcgifts.com
abcfood.com
abcstationery.com
So if a visitor enters abcfurniture.com, I want them to go to:
abc.com/furniture.html
etc. etc.
I know that I can use Header and location to direct them to a specific page. The question is how do I capture exactly which url they have entered.
I was thinking perhaps of $_SERVER[HTTP-HOST] to capture the url entered. Then I could use if ... then statements, or case, or switch with
header('Location: http://www.abc.com/furniture.html');
Any suggestions as the best way of doing this?
Incidentally, in researching this question, I have found numerous related questions involving visitors from old
pages, etc., but very little on using one domain with a number of aliases.
Your help is greatly appreciated.