<?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>FatBanker &#124; Affiliate Tips, Tricks and Techniques &#187; mod_rewrite</title>
	<atom:link href="http://fatbanker.com/tag/mod_rewrite/feed/" rel="self" type="application/rss+xml" />
	<link>http://fatbanker.com</link>
	<description>Affiliate marketing made easy - Paul Milson&#039;s blog</description>
	<lastBuildDate>Thu, 17 Sep 2009 17:24:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>To www Or Not To www</title>
		<link>http://fatbanker.com/to-www-or-not-to-www/</link>
		<comments>http://fatbanker.com/to-www-or-not-to-www/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 09:00:13 +0000</pubDate>
		<dc:creator>Paul Milson</dc:creator>
				<category><![CDATA[Make Money Online]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[webmaster tools]]></category>

		<guid isPermaLink="false">http://fatbanker.com/?p=238</guid>
		<description><![CDATA[
			
				
			
		
Most of the websites can be accessed by typing the domain name with www (like http://www.fatbanker.com) and without www (like http://fatbanker.com). 
Try to avoid using both of them. Choose the one you prefer and stick with it because if you have a preferred domain and you promote this one, Google doesn’t have to give separate [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ffatbanker.com%2Fto-www-or-not-to-www%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ffatbanker.com%2Fto-www-or-not-to-www%2F&amp;source=PaulMilson&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Most of the websites can be accessed by typing the domain name with www (like http://www.fatbanker.com) and without www (like http://fatbanker.com). </p>
<p>Try to avoid using both of them. Choose the one you prefer and stick with it because if you have a preferred domain and you promote this one, Google doesn’t have to give separate PageRank for URLs that point to the same site.</p>
<p>Opinions differ. Someone says use your domain with www because most people type URLs starting with it, others use it without www because it’s something like a subdomain. Choose whichever you think is best for you, just make sure you only use one format from the beginning.</p>
<p><strong>Add a 301 redirect using mod_rewrite</strong></p>
<p>Once you have selected your preferred domain, you can force everyone to use that domain. Simply add a 301 redirect with Apache’s mod_rewrite. It’s necessary to create or edit your existing .htaccess file. You will find it in your sites root folder – usually located in public_html folder.</p>
<p>If there is already an .htaccess file, create a backup. </p>
<p><strong>Prefer your domain with www?</strong></p>
<p>If you prefer to use www before your domain, you can copy and paste the following code to your .htaccess file:<br />
<code><br />
RewriteEngine On<br />
RewriteCond %{HTTP_HOST} !^(.*)\.fatbanker\.com$ [NC]<br />
RewriteRule ^(.*)$ http://www.fatbanker.com/$1 [R=301,L]</code></p>
<p>Of course you will need to replace fatbanker.com with your site URL. Now when your surfers access a URL like http://yourdomain.com they will be redirected to http://www.yourdomain.com. The above code redirects all yourdomain.com to www.yourdomain.com including directories and files. E.g. yourdomain.com/contact.html will be redirected to www.yourdomain.com/contact.html.</p>
<p><strong>Prefer your domain without www?</strong></p>
<p>If you want everyone visiting your website to do this without www in the URL, simply add the following lines to your .htaccess and upload it to your server:</p>
<p><code>RewriteEngine On<br />
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]<br />
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]<br />
</code></p>
<p>The above code redirects all www.yourdomain.com to yourdomain.com.</p>
<p>Some hosting provider might not show the .htaccess file or have them in read only mode. In this case you can ask them to set the 301 redirect. They will help you.</p>
<p>If you mess up your current .htaccess settings, you may get a 500 server error code when you try to access your site. In this case just upload the previously backed up file.</p>
<p><strong>Let Google know about your decision</strong></p>
<p>It’s time to tell Google which domain format you want to see in the search results. </p>
<p>Login to your existing <a href="http://www.google.com/webmasters/tools/" target="_blank" rel="nofollow">Google Webmaster Tools</a> account (or register for free) and set your preferred (canonical) domain. Some days later you will see that all of your pages are displayed in the format you wanted to see in the search results.</p>
<p>It’s great, everyone uses your preferred format and you ensure linking consistence. Having 50 incoming links to the preferred domain will receive more weight than having 20 inbound links pointing to your site with www and 30 links without www in URL. In the second case you present Google with two pages.</p>
<p>Are you using your domain with or without www? </p>
]]></content:encoded>
			<wfw:commentRss>http://fatbanker.com/to-www-or-not-to-www/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

