|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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.
|
|
#3
|
||||
|
||||
|
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! |
![]() |
| Viewing: Dev Shed Forums > Web Hosting > Web Hosting > multiple domains to one IP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|