Two url pointing same ip

Nov 6, 2008 at 7:31 AM

Hi,

I have this problem. I have two ult http://www.domainA.com and http://www.domainB.com, pointing to the same ip. I like to see different web pages for any domain, but keeping the same utl in the navigator var, like this:

  • I go to http://www.domainA.com and the url show the same
  • In my server I take the web page page.asp and add ?id=domainA but without show this into the navigation var
  • If I go to http://www.domainB.com, the server takes the url and add ?id=domainB but without show this into the navigation var

This is, I am pointing to the same url with both domains, and I need to give the parameter id in the server for show the appropiate web page, but without change the url that see the user in his browser.

Regards and thank you,

Subaru.

Coordinator
Nov 7, 2008 at 7:21 PM
You want a RewriteCond with HTTP_HOST server variable, and a RewriteRule.

RewriteCond %{HTTP_HOST}  ^(.+)$
RewriteRule  ^(.*)$    $1?%1      [L]

This isn't the final answer but it is pretty close.   For example, what if the original URL has a query string in it already?  Etc etc.
You're gonna have to test it to see what you really want.  But this is enough to get you started.