<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pictures From Earth Blog &#187; 301</title>
	<atom:link href="http://blog.picturesfromearth.com/tag/301/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.picturesfromearth.com</link>
	<description></description>
	<lastBuildDate>Tue, 26 Jul 2011 15:15:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The canonical question: to www or not to www?</title>
		<link>http://blog.picturesfromearth.com/the-canonical-question-to-www-or-not-to-www/</link>
		<comments>http://blog.picturesfromearth.com/the-canonical-question-to-www-or-not-to-www/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 22:29:03 +0000</pubDate>
		<dc:creator>Francois</dc:creator>
				<category><![CDATA[Webmaster tips]]></category>
		<category><![CDATA[301]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[pagerank]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://blog.picturesfromearth.com/?p=31</guid>
		<description><![CDATA[Since this was one of the first questions I asked myself while creating this website, I thought a little blogpost would help to explain you this important SEO issue. Canonicalization refers to the choice of choosing the best URL structure possible for your site. Should you use a www in your URL or not? I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Since this was one of the first questions I asked myself while creating this website, I thought a little blogpost would help to explain you this important SEO issue. Canonicalization refers to the choice of choosing the best URL structure possible for your site. Should you use a www in your URL or not? I&#8217;ll refer to all my choices chronologically:</p>
<p> </p>
<h3>Should I use www in my URLs or not?</h3>
<p>The short answer is: it doesn&#8217;t really matter! Some people will argue that it has become a standard on the internet to use www in your URLs, others will say that it is useless and should therefore be avoided. Personally I think it doesn&#8217;t matter! What matters is to make a choice since the very start and to stick to it! I chose to go for the version without www simply because my domain name is already quite long so I wanted to avoid too long URLs appearing in search results. So my preferred domain is http://picturesfromearth.com</p>
<p> </p>
<h3>301 redirects to your preferred domain.</h3>
<p>So why is it so important to choose a preferred domain and to stick to it? For search engines the two versions of the URL will be considered as different. So to avoid confusing search engines with different versions that it would consider as duplicate, it is better to stick to just one. Start this good habit since the beginning in the way you link internally to your site and always use the same version. Unfortunately, you can&#8217;t force other people to link to you to the right version. Some will probably use the www version or the non-www version even though you never do. It is to avoid diluting or losing these links that it is wise to make a 301 redirect to your preferred domain version. You can achieve this very easily through the .htaccess file on the root of your server.</p>
<p> </p>
<h3>.htaccess 301 redirect.</h3>
<p>To create a 301 redirect to your preferred domain, add it to your .htaccess file on the root of your site (or create a file that you name .htaccess and place it to the root of your site on your server). The code will vary according to the preferred domain you chose:</p>
<p>If your preferred domain is the non-www version ( you want to redirect www to non-www version):<br />
<code><br />
Options +FollowSymLinks<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{HTTP_HOST} !^domain\.com$ [NC]<br />
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]<br />
</code><br />
Replace &#8220;domain&#8221; with your domain name.</p>
<p>If your preferred domain is the www version ( you then want to redirect non-www to www):<br />
<code><br />
Options +FollowSymLinks<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{HTTP_HOST} !^(.*)\.domain\.com$ [NC]<br />
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]</code></p>
<p> </p>
<h3>What if I have subdomains?</h3>
<p>The code will cause problems if you have subdomains so you need to exclude them from the above code. I had the problem for my blog.picturesfromearth.com which was causing errors. To avoid this, simply add this code above the RewriteCond (and under &#8220;RewriteBase /&#8221;):<br />
<code># Stop mod_rewrite processing if “example” subdomain requested<br />
RewriteCond %{HTTP_HOST} ^example\.domain\.com<br />
RewriteRule .* - [L]</code></p>
<p>There you go! This should not have taken you very long to implement but it will prove very valuable for you in the future!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.picturesfromearth.com/the-canonical-question-to-www-or-not-to-www/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

