| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|CNAME Versus 301?|
Do I *need* a 301 on my host if I have a CNAME at my registrar?
Earlier this morning I was reading [webmasterworld.com...] and it led me to think about my 301 (or lack thereof).
I searched and found an old thread at [webmasterworld.com...] but it appears to be closed for comments.
At my registrar, the A record is set up for mydomain.com, with CNAMES for www.mydomain.com and *.mydomain.com to mydomain.com ...with the hosting company set up as the name server (three DNS names).
At the host, I haven't set up any 301s in the .htaccess (all I have there, at the moment, is names for error files - 400, 401, etc.).
I'm certainly no biggie at writing 301 code, but I *might* be able to deduce the right thing from the previously mentioned thread. But first: do I *need* to?
These post should help you get a grip on what 2 do.
and if not here is a search that you can use to get it all
Short answer - yes, the 301 is highly recommended. Mainly because search engines will have half as many pages to index, and may therefore be able to index your site more fully.
Ok: thanks, @bwnbwn and @mcavic. I've picked up the code from the threads @bwnbwn cited. Surprise, surprise: I didn't botch it! 301 in place, and all's right with the world (so far...)
Now, I'll do the same for all my clients, just for the heck of it.
|CNAMES for www.mydomain.com and *.mydomain.com to mydomain.com |
Unless you use a number of subdomains the latter (*.mydomain.com) should not be needed.
What it does is to make sure that if I type, eg.
...or something similar, that your web site at "domain.com" will be displayed at this address. I can think of only few reasons why this would be desired.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved