A
Andy-Free
Guest
Hi, I'm not sure if I'm in the right place to ask this..
I'm trying to create a URL rewrite rule that removes the www from the URL.
My web host is using Plesk (v9.5) on Windows 2008 (IIS 7 - I don't know if it's 7.0 or 7.5)
I can create a windows hosting rule that ADDS the www to a URL without it (e.g. http://example.com -> http://www.example.com), but I can't get the converse rule to work.
I have verified that the removal rule is correct by generating and testing it with the IIS 7 Rewrite Extension, which I found in Scott Guthrie's blog entry: http://weblogs.asp.net/scottgu/arch...problems-using-the-url-rewrite-extension.aspx
Here's the rule as I have it so far:
I've also tried the default rule that the IIS Rewrite Extension creates which removes any sub-domain prefix (e.g. http://blog.example.com -> http://example.com, but that doesn't work either - the URL doesn't get rewritten and the www remains.
I've asked my web host for assistance, but I thought I'd ask here as well
I'm trying to create a URL rewrite rule that removes the www from the URL.
My web host is using Plesk (v9.5) on Windows 2008 (IIS 7 - I don't know if it's 7.0 or 7.5)
I can create a windows hosting rule that ADDS the www to a URL without it (e.g. http://example.com -> http://www.example.com), but I can't get the converse rule to work.
I have verified that the removal rule is correct by generating and testing it with the IIS 7 Rewrite Extension, which I found in Scott Guthrie's blog entry: http://weblogs.asp.net/scottgu/arch...problems-using-the-url-rewrite-extension.aspx
Here's the rule as I have it so far:
<system.webServer>
<rewrite>
<rules>
<rule name="remove www" stopProcessing="true">
<match url="(www.*)" />
<action type="Rewrite" url="http://example.com" />
</rule>
</rules>
</rewrite>
</system.webServer>
I've also tried the default rule that the IIS Rewrite Extension creates which removes any sub-domain prefix (e.g. http://blog.example.com -> http://example.com, but that doesn't work either - the URL doesn't get rewritten and the www remains.
I've asked my web host for assistance, but I thought I'd ask here as well