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.

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?

share|improve this question
add comment

2 Answers 2

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.

share|improve this answer
add comment

I suggest taking a look at these similar questions.

share|improve this answer
    
I want to have it the other way around. I want the www domains to point to the empty root domain. –  unmircea 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
add comment

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.