For a domain alias to display in the address bar, is a virtualhost entry required?
I'm setting up my first server so I'm definitely a novice. Forgive me if the question has been asked before, but I searched and couldn't find an answer.
I'm setting up one website with multiple aliases (i.e. all domain names point to the same place) and I would like the various aliases to display in the browser's address bar throughout the navigation of the various pages I've set up.
I figured out that that can't happen if I create one VirtualHost entry in httpd.conf, and then add a bunch of ServerAlias entries because that just results in the browser displaying whatever I have listed as the main ServerName.
What I want to do can be acheived by creating multiple VirtualHost entries with each of them pointing to the same DocumentRoot, but that seems like a pain because then I have to re-enter the same rules for each VirtualHost. Is there a more elegant way to do this?
Please bear in mind when responding that I need an explanation that presumes I know next to nothing. :-) Thanks very much!
"I figured out that that can't happen if I create one VirtualHost entry in httpd.conf, and then add a bunch of ServerAlias entries because that just results in the browser displaying whatever I have listed as the main ServerName."
Well, I think you got that wrong The browser will display what you are accessing. Also , if you have links in your site that are not relative (you have a direct link to http://www.servername.com) then yes, you will see in the address bar the main domain since you have a link to it. Otherwise using ServerAlias is a good start.
█ IntoDNS - Check your DNS health and configuration
█ FLEIO - OpenStack billing and control panel for service providers
ServerAlias is Good. If you are trying to point multiple domains to the same Document Root, why can't you use parked domain option.
just parking over your main domain, in this way you can achieve your all domains have point the same document root.
Thanks Cristi4N. It wasn't working for me, but I realized that the problem had nothing to do with the way I was setting things up. The problem was that I was using Chrome as my browser! I'm starting to realize that it's a real mistake to work with Chrome. For whatever reason, it was pulling up the cache from my first visit as domain1 and reintroducing that into the address bar even though I was typing domain2. Ugh! I flushed the cache and things worked as described. #$#%$%*&%$ Chrome cost me hours of hair-pulling for nothing!
Rootatmike, thank you for your reply, but I have no idea what you mean when you talk about the parked domain option. Sorry.