<?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>Michael Gareth Morgan &#187; redirection</title>
	<atom:link href="http://www.michaelgarethmorgan.com/tags/redirection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michaelgarethmorgan.com</link>
	<description>Michaels website</description>
	<lastBuildDate>Tue, 03 Aug 2010 13:33:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Should you use the WWW?</title>
		<link>http://www.michaelgarethmorgan.com/should-you-use-the-www/</link>
		<comments>http://www.michaelgarethmorgan.com/should-you-use-the-www/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 14:19:09 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[301]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[redirection]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=81</guid>
		<description><![CDATA[You may or may not know that when accessing a web site you usually have the choice of typing in http://www.domain.com or just http://domain.com -the difference is of course whether or not you include the www. Both of these will normally bring you to the exact same web site with no cosmetic differences what so [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://files.michaelgarethmorgan.com/301-htaccess-redirection.jpg" alt="301 .htaccess Redirect" title="301 .htaccess Redirect" width="200" height="200" class="alignright size-full wp-image-84" />You may or may not know that when accessing a web site you usually have the choice of typing in http://www.domain.com or just http://domain.com -the difference is of course whether or not you include the www. Both of these will normally bring you to the exact same web site with no cosmetic differences what so ever.</p>
<p>The truth is that although including or excluding the www in a url makes absolutely no difference to the end user it can have a huge impact when it comes to search engines. For example, Google and Yahoo will treat both the http://www.domain.com and http://domain.com addresses as two completely different sites. So what does this mean? Well it means several things one of which is duplicate content. The search engines will see that both sites (although its the same site) have the same content and will therefore most likely exclude one from the search engines. With regards to Google PageRank your site will also be trated as two different sites each one having its own pagerank values assigned to it.</p>
<p>The fix is easy! Firstly decide whether you want to use the www version or the non-www version. To be honest it doesn&#8217;t really matter which one you use as long as you use just one of them. Then, you can either use some sort of 301 redirection or add one of these snippets of code into your .htaccess file.</p>
<p><strong>Removing the www</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">RewriteEngine On 
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>HTTP_HOST<span style="color: #009900;">&#125;</span> ^www<span style="color: #339933;">.</span>domain<span style="color: #339933;">.</span>com$ <span style="color: #009900;">&#91;</span>NC<span style="color: #009900;">&#93;</span>
RewriteRule ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$ http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//domain.com/$1 [R=301,L]</span></pre></td></tr></table></div>

<p><strong>Forcing the www</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">RewriteEngine On 
RewriteCond <span style="color: #339933;">%</span><span style="color: #009900;">&#123;</span>HTTP_HOST<span style="color: #009900;">&#125;</span> ^domain<span style="color: #339933;">.</span>com$ <span style="color: #009900;">&#91;</span>NC<span style="color: #009900;">&#93;</span>
RewriteRule ^<span style="color: #009900;">&#40;</span><span style="color: #339933;">.*</span><span style="color: #009900;">&#41;</span>$ http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//www.domain.com/$1 [R=301,L]</span></pre></td></tr></table></div>

<p>Of course in the examples above make sure you replace &#8220;domain.com&#8221; with whatever your actual domain is. This topic has been further explained &#8211; read <a href="http://www.wmtutorials.com/remove-www-your-urls-htaccess-tutorial/" title="Remove the www from your URLs">Remove the &#8220;www&#8221; from your URLs</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/should-you-use-the-www/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
