How to i setup DNS and Web so that Mac OS X Server 10.6 displays a webpage under http://domain.net instead of http://www.domain.net

www is fast becoming deprecated with people forgetting to add it. Some browsers add it and some don't.

How do i do this?

link|improve this question

62% accept rate
feedback

2 Answers

up vote 1 down vote accepted

Basically you neeed to have

  1. Dns records for www.domain.net and domain.net to point your server
  2. You need to have (i assume apache is default on mac server) on your virtualhost config/section also DomainAlias.

    ServerAdmin admin@domain.net
    
    ServerName domain.net
    
    ServerAlias www.domain.net domain.com www.domain.com
    
    DocumentRoot /home/sivu/public
    

That way your server will hand over site were it requested with or without www.

Not sure where you can actually manage configuration on mac os x server. If you have default configuration (this site is (maybe only) default site). Then you don't have to do anything else than #1. In linux environment those config files can be found from /etc/apache2/sites-available. Mac prob have some control-panel for this.

link|improve this answer
feedback

I suggest taking a look at these similar questions.

link|improve this answer
I want to have it the other way around. I want the www domains to point to the empty root domain. – basilmir Feb 13 '11 at 11:19
Regardless of which canonical form you prefer, you use the same techniques to enforce it. – Nic Feb 14 '11 at 7:38
feedback

Your Answer

 
or
required, but never shown

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