<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: ASP: NON-WWW 301 Redirect on IIS</title>
	<atom:link href="http://www.davidbehan.com/blog/index.php/non-www-301-redirect-on-iis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/</link>
	<description>David Behan's Blog on web design, the Internet, business and company news</description>
	<lastBuildDate>Wed, 04 Jan 2012 20:20:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rajesh Kumar</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-55898</link>
		<dc:creator>Rajesh Kumar</dc:creator>
		<pubDate>Mon, 31 Oct 2011 09:09:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-55898</guid>
		<description>Hi,

Thanx for your working script for the canonical issue solution.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanx for your working script for the canonical issue solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jack</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-53469</link>
		<dc:creator>jack</dc:creator>
		<pubDate>Fri, 12 Aug 2011 15:19:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-53469</guid>
		<description>the code gives me 
Server Error500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

please help, as I&#039;m looking for solution since long. thanks.</description>
		<content:encoded><![CDATA[<p>the code gives me<br />
Server Error500 &#8211; Internal server error.<br />
There is a problem with the resource you are looking for, and it cannot be displayed.</p>
<p>please help, as I&#8217;m looking for solution since long. thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-44669</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Wed, 29 Sep 2010 22:56:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-44669</guid>
		<description>Hi David,
 
I have just put your script on my website and its working great. Thank you for sharing the script. 
 
I wondered if you could help me. I have been trying to alter your code to allow for the correct url format  http://www.website.com/index.asp to be redirected to http://www. website.com/ . This way I have all the canonical issues covered. 
 
Regards
 
Jonathan</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>I have just put your script on my website and its working great. Thank you for sharing the script. </p>
<p>I wondered if you could help me. I have been trying to alter your code to allow for the correct url format  <a href="http://www.website.com/index.asp">http://www.website.com/index.asp</a> to be redirected to <a href="http://www">http://www</a>. website.com/ . This way I have all the canonical issues covered. </p>
<p>Regards</p>
<p>Jonathan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nik</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-39607</link>
		<dc:creator>Nik</dc:creator>
		<pubDate>Sun, 24 Jan 2010 21:13:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-39607</guid>
		<description>you can use IIRF filter. 

RewriteCond  %{HTTP_HOST}  ^domain\.com$
RedirectRule ^/(.*)$       http:/www.domain.com/$1         [R=301]</description>
		<content:encoded><![CDATA[<p>you can use IIRF filter. </p>
<p>RewriteCond  %{HTTP_HOST}  ^domain\.com$<br />
RedirectRule ^/(.*)$       http:/www.domain.com/$1         [R=301]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marky</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-38192</link>
		<dc:creator>marky</dc:creator>
		<pubDate>Tue, 01 Dec 2009 02:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-38192</guid>
		<description>hi! David,
I&#039;ve tested your script and works fine... However my requirement is from http://www.domain.com to http://domain.com Any help of what should change along the line to make it work as I intended.
Thank for the help.</description>
		<content:encoded><![CDATA[<p>hi! David,<br />
I&#8217;ve tested your script and works fine&#8230; However my requirement is from <a href="http://www.domain.com">http://www.domain.com</a> to <a href="http://domain.com">http://domain.com</a> Any help of what should change along the line to make it work as I intended.<br />
Thank for the help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Free</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-37381</link>
		<dc:creator>Free</dc:creator>
		<pubDate>Tue, 03 Nov 2009 00:58:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-37381</guid>
		<description>Hi David ;

thank you so much for your great code;

with &quot; svrNewUrl = replace(svrNewUrl,”default.asp”,”&quot;)   &quot;

i research it on the net since a few months... 
thank you thank you, again.. it s worked good</description>
		<content:encoded><![CDATA[<p>Hi David ;</p>
<p>thank you so much for your great code;</p>
<p>with &#8221; svrNewUrl = replace(svrNewUrl,”default.asp”,”&#8221;)   &#8221;</p>
<p>i research it on the net since a few months&#8230;<br />
thank you thank you, again.. it s worked good</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-36679</link>
		<dc:creator>John</dc:creator>
		<pubDate>Wed, 14 Oct 2009 14:47:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-36679</guid>
		<description>I&#039;m having to deal with this issue for two different classic ASP sites at the same time - one on a dedicated server and the other on shared hosting.

One ASP/ASP.Net shared hosting company that offers the IIS Mod-Rewrite pre-installed on its servers is CrystalTech.

Your suggestion for dealing with non-www redirect for ASP is about the best one I can find.  Thanks.</description>
		<content:encoded><![CDATA[<p>I&#8217;m having to deal with this issue for two different classic ASP sites at the same time &#8211; one on a dedicated server and the other on shared hosting.</p>
<p>One ASP/ASP.Net shared hosting company that offers the IIS Mod-Rewrite pre-installed on its servers is CrystalTech.</p>
<p>Your suggestion for dealing with non-www redirect for ASP is about the best one I can find.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-35577</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 23 Aug 2009 18:17:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-35577</guid>
		<description>Hi Tony,

It shouldn&#039;t add default.asp as there is a line in the code that actually removes that from the new url, i.e.

svrNewUrl = replace(svrNewUrl,&quot;default.asp&quot;,&quot;&quot;)

The only thing I can think of is that it&#039;s adding Default.asp maybe and isn&#039;t removing it properly then.

If so, change this line:

svrNewUrl = svrNewUrl &amp; svrHost &amp; svrUrl

to:

svrNewUrl = lcase(svrNewUrl &amp; svrHost &amp; svrUrl)

and give it another go. If you want to pop me a url to see a live example, I might be able to diagnose.

HTH, Dave</description>
		<content:encoded><![CDATA[<p>Hi Tony,</p>
<p>It shouldn&#8217;t add default.asp as there is a line in the code that actually removes that from the new url, i.e.</p>
<p>svrNewUrl = replace(svrNewUrl,&#8221;default.asp&#8221;,&#8221;")</p>
<p>The only thing I can think of is that it&#8217;s adding Default.asp maybe and isn&#8217;t removing it properly then.</p>
<p>If so, change this line:</p>
<p>svrNewUrl = svrNewUrl &#038; svrHost &#038; svrUrl</p>
<p>to:</p>
<p>svrNewUrl = lcase(svrNewUrl &#038; svrHost &#038; svrUrl)</p>
<p>and give it another go. If you want to pop me a url to see a live example, I might be able to diagnose.</p>
<p>HTH, Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-35476</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Tue, 18 Aug 2009 15:09:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-35476</guid>
		<description>Hi David,

Thanks for the script! It works perfect on all pages except the home page. The problem is; the script is adding default.asp to the domain. 

Example: http://domain.com turns into http://www.domain.com/default.asp

How do I remove Default.asp?

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>Thanks for the script! It works perfect on all pages except the home page. The problem is; the script is adding default.asp to the domain. </p>
<p>Example: <a href="http://domain.com">http://domain.com</a> turns into <a href="http://www.domain.com/default.asp">http://www.domain.com/default.asp</a></p>
<p>How do I remove Default.asp?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.davidbehan.com/blog/non-www-301-redirect-on-iis/comment-page-1/#comment-35381</link>
		<dc:creator>David</dc:creator>
		<pubDate>Fri, 14 Aug 2009 08:47:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidbehan.com/blog/?p=34#comment-35381</guid>
		<description>Yeah, I&#039;ll have to have a look why that&#039;s happening. CMS probably converted those automatically on save. Glad you like it.</description>
		<content:encoded><![CDATA[<p>Yeah, I&#8217;ll have to have a look why that&#8217;s happening. CMS probably converted those automatically on save. Glad you like it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

