<?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>Jamie Nay &#187; Server</title>
	<atom:link href="http://jamienay.com/category/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamienay.com</link>
	<description>A PHP web developer writing about the web.</description>
	<lastBuildDate>Wed, 02 Jun 2010 17:09:28 +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>htaccess trick &#8211; redirect to WWW domain without hardcoding the domain name</title>
		<link>http://jamienay.com/2010/01/htaccess-trick-redirect-to-www-domain-without-hardcoding-the-domain-name/</link>
		<comments>http://jamienay.com/2010/01/htaccess-trick-redirect-to-www-domain-without-hardcoding-the-domain-name/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 21:31:50 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://jamienay.com/?p=531</guid>
		<description><![CDATA[I&#8217;m notoriously bad at writing good htaccess redirection rules, so when it came time to write a rule that would redirect any non-www URL to its www equivalent, I was a bit lost. I wanted a rule that I could apply to any website without needing to hard-code the domain. I found a few examples [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m notoriously bad at writing good htaccess redirection rules, so when it came time to write a rule that would redirect any non-www URL to its www equivalent, I was a bit lost. I wanted a rule that I could apply to any website without needing to hard-code the domain. I found a few examples after some Google searching, but nothing worked for me. So, <a href="http://muffinstump.ca">a colleague</a> and I came up with this rule, which does the job:</p>
<pre>RewriteCond %{HTTP_HOST} ^([a-z-]+)\.([a-z]{2,6})$ [NC]
RewriteRule ^(.*)$ http://www.%1\.%2/$1 [R=301,L]</pre>
<p>Can it be improved? You tell me!</p>
]]></content:encoded>
			<wfw:commentRss>http://jamienay.com/2010/01/htaccess-trick-redirect-to-www-domain-without-hardcoding-the-domain-name/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
