<?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>Chris: Geek Guy &#187; www</title>
	<atom:link href="http://chris.gg/tag/www/feed/" rel="self" type="application/rss+xml" />
	<link>http://chris.gg</link>
	<description>Tech news and other stuff from a UK-based web developer and all-round geek</description>
	<lastBuildDate>Tue, 06 Dec 2011 19:40:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Using ISAPI Rewrite to redirect domain.com to www.domain.com</title>
		<link>http://chris.gg/2010/03/using-isapi-rewrite-to-redirect-domain-com-to-www-domain-com/</link>
		<comments>http://chris.gg/2010/03/using-isapi-rewrite-to-redirect-domain-com-to-www-domain-com/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 12:18:00 +0000</pubDate>
		<dc:creator>Chris Barnes</dc:creator>
				<category><![CDATA[Hints & Tips]]></category>
		<category><![CDATA[isapi_rewrite]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[www]]></category>
		<guid isPermaLink="false">http://chris.gg/?p=643</guid>
		<description><![CDATA[My employer&#8217;s SharePoint-powered external website &#8211; which I look after &#8211; uses ISAPI Rewrite to provide &#8220;friendly&#8221; URLs for certain pages, and also to redirect old URLs to their new locations. Coming from a LAMP background, this is great for me as it basically works the same as Apache&#8217;s mod_rewrite. Previously the website responded to [...]]]></description>
			<content:encoded><![CDATA[<p>My employer&#8217;s SharePoint-powered external website &#8211; which I look after &#8211; uses <a href="http://www.isapirewrite.com/">ISAPI Rewrite</a> to provide &#8220;friendly&#8221; URLs for certain pages, and also to redirect old URLs to their new locations. Coming from a <acronym title="Linux, Apache, MySQL, PHP">LAMP</acronym> background, this is great for me as it basically works the same as Apache&#8217;s <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">mod_rewrite</a>.</p>
<p>Previously the website responded to requests for both <strong>domain.com</strong> and <strong>www.domain.com</strong>, which is not ideal. <acronym title="Search Engine Optimisation">SEO</acronym> best practice is to either redirect the non-WWW version to the WWW version, or vice-versa. In my case, <strong>www.domain.com</strong> is the preferred format, so I&#8217;m using the following rule:</p>
<pre lang="mysql">### Redirect domain.com to www.domain.com
RewriteCond Host: ^domain\.com
RewriteRule (.*) http\://www\.domain\.com$1 [I,RP]</pre>
<p>If you want to do the opposite, you&#8217;ll need this one:</p>
<pre lang="mysql">### Redirect www.domain.com to domain.com
RewriteCond Host: ^www\.domain\.com
RewriteRule (.*) http\://domain\.com$1 [I,RP]</pre>
]]></content:encoded>
			<wfw:commentRss>http://chris.gg/2010/03/using-isapi-rewrite-to-redirect-domain-com-to-www-domain-com/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

