Forum Moderators: phranque
I have a site on a virtual directory (www.domain1.com) on Apache/1.3.20
I have two other domain’s DNS entries pointing to the same virtual directory.
www.domain2.com
www.domain3.com
Currently, when someone goes to www.domain2.com the site reads, “www.domain1.com”when the page comes up.
Here’s the question: Is it possible, when a user goes to either domain2 or domain3 that I can have those domain names be what the user sees? If so, what would I need to do?
This is NOT the default behaviour of the scenario you describe.
Check for three problems:
1) DNS is using forwarding, not an "A record"
2) mod_rewrite is already being used (improperly) and is modifying the domain.
3) The "entry page" immediately redirects to another page using a canonical URL (URL includes "http://www...")
In order to change the URL in the visitor's browser address bar, an external redirect must be issued. I would not expect a normal DNS/hosting setup to issue such a redirect.
That is the likely cause of your problem. After you get that fixed, you should make sure that all of the pages on the site use non-canonical URLs, that is, refer to pages only as <href="/page.php"> or <href="../../more/page"> or <href="stuff.html">; Do not include the "http://" part.
Jim