3 ms·
The preferred way is to choose either www.example.com or example.com and let only one of them resolve, while the other should issue a 301 ("Moved permanently")
by speleding 13y ago
The preferred way is to choose either www.example.com or example.com and let only one of them resolve, while the other should issue a 301 ("Moved permanently") back to the one that resolves.
The easier one to set up is to prefer the www version since it can be done with a simple CNAME and many DNS providers will offer a free automatic 301 forward for the non-www version. (But tastes differ on whether the non-www version looks better.)
Letting both versions resolve would give issues with Google indexing multiple versions of the same page, and reduces the ability to cache properly.
- tombrossman 13y agoI'm looking to park a few low-traffic charity sites there and 'Set it and forget it' (like Ron Popeil). I think having both with and without the www working is a higher priority than SEO, so I'll have to compromise and set A records for example.com and CNAME for www. If anyone figures out a better practice please leave a comment. My preference is no www (with www 301-ing) plus the CDN benefit, but this probably isn't possible.