Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hopefully a very simple question ...

With a Linux server how can I get 3 different domains to all point at the same server and show exactly the same application, but with the different domains still showing in the browser address bar?

Is it just a case of setting the DNS for each domain the same or would the server require some configuration too?

share|improve this question

migrated from stackoverflow.com May 20 '11 at 3:11

This question came from our site for professional and enthusiast programmers.

3 Answers 3

up vote 1 down vote accepted

Assuming this is an Apache web server, you would need to point all of the domains to this server, and then configure Apache to serve the site site to these three domains. Check out the docs here: http://httpd.apache.org/docs/current/mod/core.html#serveralias. It depends on how your server is configured, but you most likely just need to add the different domains as multiple aliases.

share|improve this answer
    
sorry for the delay in response. the domains are all pointing at the server but it's shared so i don't have access to the server's http.conf file for setting up a new vhost. apparently i can do this with an .htaccess file but i'm not sure how to go about that? –  davidhyland Jun 8 '11 at 16:09
    
so in summary, each of the 3 domains needs to point to the same application folder on the server where i will use $_SERVER['HTTP_HOST'] to determine the domain and change the site config appropriately (unless there's a better way?) –  davidhyland Jun 8 '11 at 16:10
    
Are you given a specific folder on this server to put your application? If so, you might just need to point the domains there then. You won't know for sure if you don't have access to apache, but you can just try it in DNS alone, and it will likely work as you expect. –  Paul Kroon Jun 8 '11 at 17:16

Assuming you have a simple web server set up: Set the "A Record" for each of the domains to point to the same ip address. This would be done from your domain provider's (e.g. godaddy's) control panel.

share|improve this answer

Nope - it's all done in the DNS server: See http://technet.microsoft.com/en-us/library/bb727018.aspx

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.