Jump to content


Photo

Parked Domains


  • Please log in to reply
3 replies to this topic

#1 fatboy14

fatboy14
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 April 2006 - 10:31 AM

Hi there,

I have about 300 registered domain names which are all pointing to the DNS server of my webhost.
There is one main domain called "http://www.wine.info".
I have parked all other domains at the host.
If a surfer wants to go to one of the domains for example [a href=\"http://www.redwines.info\" target=\"_blank\"]http://www.redwines.info[/a] he/she will be redirected to the index page of the main domain [a href=\"http://www.wine.info\" target=\"_blank\"]http://www.wine.info[/a] while the browser's address bar shows [a href=\"http://www.redwines.info\" target=\"_blank\"]http://www.redwines.info[/a].

The question is how to intercept the [a href=\"http://www.redwines.info\" target=\"_blank\"]http://www.redwines.info[/a] (requested URL), so I can check it against a MySQL database to be redirected to a relevant section of my website?

Thanks for your attention,

NB domain names are fictive




#2 bbaker

bbaker
  • Members
  • PipPipPip
  • Advanced Member
  • 127 posts
  • LocationNY

Posted 05 April 2006 - 02:48 PM

you should be able to use $_SERVER['SERVER_NAME'] to get the current domain. So, if you're on "http://www.redwines.info", it will be redwines.info

#3 fatboy14

fatboy14
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 April 2006 - 03:43 PM

[!--quoteo(post=361954:date=Apr 5 2006, 04:48 PM:name=bbaker)--][div class=\'quotetop\']QUOTE(bbaker @ Apr 5 2006, 04:48 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
you should be able to use $_SERVER['SERVER_NAME'] to get the current domain. So, if you're on "http://www.redwines.info", it will be redwines.info
[/quote]


#4 fatboy14

fatboy14
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 April 2006 - 03:55 PM

Thanks, but that is the problem.
If the user is redirected to www.wine.info, indeed $_SERVER['SERVER_NAME'] gives the current domain which is www.wine.info not the requested www.redwine.info. What I would like to track is that the user surfed to www.redwine.info (which is displayed in the browser's address bar) and re-direct to the red wine section of the site www.wine.info.

Maybe I'm searching in the wrong direction, if the redirection is done by the apache server on which the site resides there might be a PHP readable variable somewhere which states the original requested URL.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users