change HTTP_HOST using php, keeping php variables?

  • Thread starter Thread starter KDalby
  • Start date Start date
K

KDalby

Guest
I have to change the HTTP_HOST on some pages to avoid getting an error. Right now saltlake.org, ski-saltlake.com and meetinsaltlake.com share the same IP address with visitsaltlake.com so they all point to the same sets of files. My only problem with this is that I get an error message that says our google maps API key is registered to another address. The map works fine -- I just want to get rid of the error message.
What I need is to change the ski-saltlake.com (or saltlake.org or meetinsaltlake.com) in:

http://www.ski-saltlake.com/member_details.php?m=54399&s=ski

to visitsaltlake.com.

I currently have:
<code>
//redirect ski-saltlake.com to visitsaltlake.com to remove registration error
if ($_SERVER['HTTP_HOST'] == "www.ski-saltlake.com"||$_SERVER['HTTP_HOST'] == "ski-saltlake.com") {
header('Location: http://www.visitsaltlake.com/member_details.php');
}
//redirect saltlake.org to visitsaltlake.com to remove registration error
if ($_SERVER['HTTP_HOST'] == "www.saltlake.org"||$_SERVER['HTTP_HOST'] == "saltlake.org") {
header('Location: http://www.visitsaltlake.com/member_details.php');
}
</code>

But this won't let me keep the php variables being passed in the URI - it just resets the page (and the page is useless without a member ID).

This only affects ONE page of code on our site, so I can make any changes I need to in the header section.

Thanks in advance for any help!
 
Back
Top