Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have two domain names, domain1.tld, and domain2.tld. In DNS, both have A records pointing to the same ip address, 33.44.55.66. www.domain1.tld and www.domain2.tld are CNAME aliases for their respective domains.
when i visit www.domain1.tld, everything is fine. However, when I visit www.domain2.tld, it is redirected to domain2.tld instead of maintaining the 'www' portion. What could be causing this?
Thanks,
Jameson
Last edited by jhwilliams; 05-20-2008 at 06:45 PM.
Reason: forgot code tags
My first thought is that the ServerName for domain2 is "domain2.tld" and not "www.domain2.tld". In other words, you're *telling* the server that the name of the virtual host does not have a host name. Although, depending on what the rest of your httpd.conf, other configuration files, and servered pages contain - you may also want to look at what other directives are being given to the server (e.g. mod_rewrite). Oh, and take a look at the docs regarding AllowOverride - setting it to "All" could give you some headaches if you're not the only one with write permissions to that documentRoot.
When I change the ServerName of domain2.tld to www.domain2.tld, it just redirects to www.domain1.tld, like the request isn't being "caught" by Apache. I would change the DNS records, but it works fine for domain1.tld, so I don't see what the difference should be?
And yes, each virtual host has it's own user. :-)
I have mod_rewrite on, which changes domain1.tld to www.domain1.tld, and I have the same code for domain2. However, the problem pervades with and without the rewrite from domain2.tld to www.domain2.tld; either way, I keep getting domain2.tld.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.