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.

Perhaps an easy question, but had difficulty finding a way to phrase it so that google gave results.

Currently I have www.domain.com alpha.domain.com demo.domain.com

However, doing to domain.com gives the results for alpha.domain.com, rather than www.domain.com. What is the proper CNAME/A Record approach to doing this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I assume by "going to" you mean in a web browser?

If so, and they all have the same IP address, you'll need either:

  • a host header configured on the site hosting www.domain.com for domain.com, or
  • www.domain.com to become the default web site.

If this is IIS, the second can be accomplished by ensuring the other sites use the appropriate host headers.

share|improve this answer
1  
Great this pointed me in the right direction. Ended up using ServerAlias www.domain.com domain.com in my VirtualHost file. Turns out Apache was defaulting to the first one it found, which happened to be alpha.domain.com –  Brett van Zuiden Mar 24 '11 at 4:41
2  
Its better to have apache redirect domain.com to www.domain.com using a 301 (permanant redirect). This will tell spiders like google that you only want www.domain.com indexed, and that's where you want all your traffic going, even if other link to domain.com/foo, this can improve your search engine placement by consolidating everyting. –  stew Mar 24 '11 at 11:05

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.