Ever since Web addresses started appearing in print, it’s been tempting to lop the "www" off to make the URL easier to remember and to use.
Does it matter if you do that? Is a www address better for SEO? If a viewer uses www, will the page show up differently than if they don’t?
Though the "does www matter" question can spark holy wars, in general nothing bad will happen whether visitors type in www or leave it off. But there are things you should handle with care, lest your SEO campaign suffer.
Should I Use WWW or Not?
When you register a domain name, you register example.com, not www.example.com. That’s because the www part of the URL is actually considered a subdomain, much like blog.example.com, login.example.com, etc. The www largely is a carryover from the days of the Internet when you had to specify that you were using a World Wide Web site and not something like gopher or ftp.
While most of the time typing www.example.com and example.com will take users to the same place, they are technically different URLs that could be set up to display different content.
Now for the bad news. When it comes to domains, Google practices what’s called canonicalization, the process of selecting a "preferred domain" URL that best represents the site. If the site owner doesn’t choose one, Google will decide which URL to index.
If Google picks http://example.com but all your links point to www.example.com, then the fruits of your efforts are being diluted, causing a disadvantage to your SEO campaign.
The Preferred Domain
Thankfully, you can choose a preferred domain rather than leaving it to chance. Log in to Google Webmaster Toolsand follow these steps:
- Click on your site on the Webmaster Tools home page.
- Click on the gear icon and then click Site Settings.
- Find the Preferred domain section and select the option you want.
If you built your site without selecting a preferred domain, any links to your non-preferred domain won’t benefit your preferred one from an SEO perspective, unless your non-preferred one redirects to the corresponding preferred version using a 301 redirect.
What Is a 301 Redirect?
A 301 redirect is the HTTP status code for when a page has been moved permanently to a new location or URL.
In our case, if we set http://example.com as our preferred domain, we can set a 301 redirect for www.example.com, Similarly, we also can do this for www.example.com/index.html or www.example.com/index.php.
With a 301 redirect, the value of inbound links as well as historic/trust records for one URL will move to the other, though there’s debate as to just how much of this benefits are passed on to the new URL. While estimates vary, I’ll address this a bit later in this article.
Setting Up the 301 Redirect
To set up a 301 redirect on an Apache server, you have to open your .htaccess in a text editor, then enter one of these snippets of code into your file and save it.
For redirecting a non-www URL to a www URL:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1
[R=301,L]
For redirecting a www URL to a non-www URL:
Options +FollowSymLinks
RewriteEngine on RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example\.com
RewriteRule (.*) http://example.com/$1
[R=301,L]
If your website is based on WordPress, dozens of free plugins exist to help you easily set up and manage 301 redirects. A simple one I prefer to use is called "Simple 301 Redirects."
You can test your redirect by simple visiting your old URL; if you’re immediately taken to the new URL, it’s working.
The 301 Redirect and Inbound Links
You might have heard that using a 301 redirect can lead to losing 15 percent of your "link juice." Many sites quote Matt Cutts, Google’s head of Web spam, as having made that statement. To the contrary, Cutts said in this video that links passed from one domain to another using a 301 result in no loss of link juice. However, skeptics remain, and many SEO professionals are hesitant to take Cutts’ word as truth.
What About rel="canonical"?
Some SEO professionals recommend using rel="canonical" instead of 301-redirects because they think that 301 redirects could hurt performance due to a browser having to make an extra trip. Again, Cutts has debunked this myth, stating in this video that while the rel="canonical" tag is effective, browsers and search engines both know how to deal with a 301 redirect
No comments:
Post a Comment