1

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?

1 Answer 1

1

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.

2
  • 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 Mar 24, 2011 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, 2011 at 11:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .