To WWW or not to WWW
To WWW or not to WWW, which would you prefer for your domain?
Just to share some information, your site can be reached via two addresses. For example, this blog can be reached by using:
However, it is best to use only one address for your blog. This will be your preferred domain.
Why do I need to have a preferred domain?
For people, it does not matter if you have two addresses. However, for search engines it does.
Search engines are not able to conclude that http://silkenhut.com and http://www.silkenhut.com are just one and the same. Search engines will treat these address as two separate sites. Check out these google queries for silkenhut.com.
- info:silkenhut.com – Google replies, “Oh I know about you! I will be showing web page information for silkenhut.com“
- info:www.silkenhut.com – Google replies, “Who are you? Uhh Sorry, no information is available for the URL www.silkenhut.com“
As you can see, these addresses are supposed to lead to the same site but Mr. Google only knows about one of them.
If you are concerned about your search engine rankings/results, page rank and other similar search engine stuffs, then you should only have one address. Having two address divides your site. You can also be flagged for duplicate content since http://yourdomain/yeah.html will be considered a duplicate for http://www.yourdomain.com/yeah.html.
How do I use only one address?
- You can use a wordpress plug-in called Enforce www. Preference.
- You can modify your .htaccess to provide a redirection.
Which do you prefer?- I prefer to have www in my address because having www is cool! (if someone types in http://yoursite.com, it will become http://www.yoursite.com)Copy this code to your .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$ [NC]
RewriteRule ^.*$ http://yoursite.com%{REQUEST_URI} [R=301,L]
</IfModule> - I prefer to have no www in my address because having no www is cool! (if someone types in http://www.yoursite.com, it will become http://yoursite.com)Copy this code to your .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^.*$ http://domain.com%{REQUEST_URI} [R=301,L]
</IfModule>
- I prefer to have www in my address because having www is cool! (if someone types in http://yoursite.com, it will become http://www.yoursite.com)Copy this code to your .htaccess
Now decide which one do you want, to www or not to www?
.htaccess code cited from Nate White Hill dot com
| enforce only one version of your website (www or no-www) | enforce www or not | having www or not for wordpress
I didn’t know this matters. pero ngayon sinabi mo na, I’ll take note of this. may dalawang domain ako eh
anyways, I’m going to email you regarding an invitation to err (not here), probably sa gmail mo na since loyal ako doon. lol
It matters if you are after for search engine rankings and pagerank. Thanks , I got your email.
Good post! Btw, you need to edit this line – “Why do I need to have a proffered domain?” Hehe
I use the Enforce .www Preference and I’ve also configured my domain to strip off the www prefix from my webhosting user panel.
Ops! Typo! Sorry haha
Hmm I also installed enforce www preference but I dont know where to configure it so I just use the .htaccess method. =)
Thanks for visiting.
[...] edit your .htaccess file using a program and risk lesser problems that editing it manually. I once edited my .htaccess to remove the “www” when you access my [...]