Search
Home IIS.NET Forums IIS 7 & IIS 8 Configuration & Scripting How to redirect www to non www domains in websitepanel
Last post Feb 23, 2012 01:27 PM by owjeff
1 Post
Feb 23, 2012 12:03 PM|LINK
www to non www domain iis redirection
680 Posts
Feb 23, 2012 01:27 PM|LINK
I would use URL rewrite to do this:
http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/
You'll need a rule that checks for the www and redirects if found:
http://weblogs.asp.net/owscott/archive/2009/11/30/iis-url-rewrite-redirect-multiple-domain-names-to-one.aspx
Likely something like:
<rule name="Redirects to domain.com" patternSyntax="ECMAScript" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^www\.domain\.com$" /> </conditions> <action type="Redirect" url="http://domain.com/{R:0}" /> </rule>
medxpower
1 Post
How to redirect www to non www domains in websitepanel
Feb 23, 2012 12:03 PM|LINK
www to non www domain iis redirection
owjeff
680 Posts
Re: How to redirect www to non www domains in websitepanel
Feb 23, 2012 01:27 PM|LINK
I would use URL rewrite to do this:
http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/
You'll need a rule that checks for the www and redirects if found:
http://weblogs.asp.net/owscott/archive/2009/11/30/iis-url-rewrite-redirect-multiple-domain-names-to-one.aspx
Likely something like:
<rule name="Redirects to domain.com" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^www\.domain\.com$" />
</conditions>
<action type="Redirect" url="http://domain.com/{R:0}" />
</rule>
OrcsWeb: Managed Windows Hosting Solutions
"Remarkable Service. Remarkable Support."