#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Posts
    26
    Rep Power
    0

    Question multiple domains to one IP


    Quick question. I have multiple domains that I want directed to the same site. For example, mydomain.com is the main site. I also own mydomain.net and mydomain.org, and I want these two domains to point to mydomain.com.

    Other than setting up the DNS so that all domains point to the same IP, what do I need to do to the Apache conf?

    As it is right now, the DNS has been changed and nothing has been done to Apache. Sure enough, mydomain.net points where it should (to the mydomain.com site), but the URL in the location bar remains mydomain.net. Ideally, I would like the URL to change from mydomain.net to mydomain.com as soon as the browser opens the homepage.

    Hope this isn't too confusing.

    Thanks for any help!

    Jon
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Montreal
    Posts
    19
    Rep Power
    0

    IP Aliasing?


    a Friend tells me you need to get IP Aliasing Setup, I have no idea if this is right but it would give you something to look at.
  4. #3
  5. 11
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jul 2001
    Location
    Lynn, MA
    Posts
    4,635
    Rep Power
    82
    IP aliasing is kind of barking up the wrong tree. You'd use IP aliasing if you wanted to have more than one IP go to the same machine/NIC, I believe.

    Anyway, what you need to do in httpd.conf is set up a <Virtual Host> container for each domain you're hosting on the same IP.

    Read the apache docs at www.apache.org.

    You'll want to look into "name based virtual hosting."


    It'll kind of look like this (off the top of my head):

    Code:
    NameVirtualHost *
    
    <VirtualHost *>
    ServerName www.mydomain.com
    ServerAlias *.mydomain.com www.mydomain.com
    DocumentRoot /home/www/mydomain.com/
    #Whatever else you want to define-custom access logs,
    #cgi-bin alias, etc.
    </VirtualHost>
    
    <VirtualHost *>
    ServerName www.myotherdomain.com
    ServerAlias *.myotherdomain.com www.myotherdomain.com
    DocumentRoot /home/www/myotherdomain.com/
    #Whatever else you want to define-custom access logs,
    #cgi-bin alias, etc.
    </VirtualHost>
    Good luck!

IMN logo majestic logo threadwatch logo seochat tools logo