Welcome to WebmasterWorld Guest from 54.163.84.199

Forum Moderators: buckworks & webwork

Removing "www" using CNAMES

Is it possible to remove the www prefix using cnames

   
9:59 pm on Jun 3, 2007 (gmt 0)

5+ Year Member



Hi all,

I'm trying to have the "www" subdomain automatically removed from my URLs. I haven't been able to get any of the mod_rewrite functionality to work (Shared hosting is very buggy about that).

I had thought of an alternative way of removing the prefix, but I couldn't find anything on the net about it. What if you pointed the www CNAME to "yourdomain.com"? Does anybody know if Google would handle that correctly?

[edited by: Webwork at 10:17 pm (utc) on June 3, 2007]
[edit reason] Charter [webmasterworld.com] [/edit]

10:28 pm on Jun 3, 2007 (gmt 0)

5+ Year Member



In the webmaster toolkit on Google sitemaps (I think) you can set how you want your site indexed, with www or not.

That might help...

5:20 pm on Jun 4, 2007 (gmt 0)

WebmasterWorld Senior Member jtara is a WebmasterWorld Top Contributor of All Time 5+ Year Member



Define "remove".

I assume that what you mean is that when a user types www.example.com into the URL bar and hit return, it will be changed to example.com.

Assuming that is what you mean, the ONLY way to accomplish this is with a rewrite. And the only way to accomplish this is with a web server. There's nothing you can do with DNS to accomplish this.

User's browser sends a GET to a web server. Web server sends back a "301, moved permanently" to the browser. Browser updates the URL bar and sends a new request.

Note, however, that I said *a* web server. It doesn't have to be the same web server that you serve your site with.

Many DNS providers offer a "redirect" service. This is where the confusion comes in, and causes the erroneous notion that DNS has some redirect capability - it doesn't. The DNS provider has a web server set-up specifically to do redirects.

So, see if your DNS provider (most often your registrar) offers this. Since this is not actually a DNS feature, but an additional service offered as a convenience by the DNS provider, it's hard to give exact advice on how to do this, since the implementation varies from provider to provider.

11:11 pm on Jun 4, 2007 (gmt 0)

10+ Year Member



I regularly ask my hosting company to disable the www-version of my site, only leaving the non-www version active (http://example.com instead of http://www.example.com)

[edited by: Webwork at 10:44 am (utc) on June 5, 2007]
[edit reason] Charter [webmasterworld.com] [/edit]

11:24 pm on Jun 4, 2007 (gmt 0)

WebmasterWorld Senior Member jtara is a WebmasterWorld Top Contributor of All Time 5+ Year Member



I don't think it's a good idea to remove the www. Too many users expect it to be there, and will enter it on type-in.

Much better to do a redirect to your canonical domain name.

And, yes, I am in the minority who - like you - prefer the simpler "non-www" to www.

1:08 am on Jun 18, 2007 (gmt 0)

5+ Year Member



Thanks everyone! After a whole lot of toiling with tech support, they finally got the Rewrite Engine working, so I've just had the "www." do a 301 redirect to the non-www.

I did log in and tell Google that I preferred no www... thanks again for the help!

 

Featured Threads

Hot Threads This Week

Hot Threads This Month