Results 1 to 4 of 4
  1. #1

    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!

  2. #2
    Join Date
    Jun 2006
    Location
    Cluj Napoca
    Posts
    468
    "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

  3. #3
    Join Date
    Aug 2009
    Location
    Bangalore
    Posts
    59
    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.

  4. #4
    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.

Similar Threads

  1. httpd.conf virtualhost entry
    By winlinfix in forum Web Hosting
    Replies: 1
    Last Post: 03-31-2008, 01:17 AM
  2. PHP display Visitors ip address
    By ratchethosting in forum Programming Discussion
    Replies: 4
    Last Post: 09-02-2006, 07:35 PM
  3. Display IP address in php?
    By Jeremy in forum Web Hosting Lounge
    Replies: 5
    Last Post: 09-18-2003, 11:33 AM
  4. Display IP Address in form
    By brianlim in forum Programming Discussion
    Replies: 1
    Last Post: 05-28-2003, 11:39 AM
  5. VirtualHost Entry in httpd.conf
    By ChickenSteak in forum Hosting Security and Technology
    Replies: 21
    Last Post: 12-25-2002, 06:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •