asp.net - Redirect from non www to www and also support subdomain -
i need redirect website when user enters url without non www, , should redirect www.
example: abc.com www.abc.com
and need support subdomain url too.
example: abc.xyz.com www.abc.xyz.com
<system.webserver> <validation validateintegratedmodeconfiguration="false" /> <rewrite> <rules> <rule name="non-www www" enabled="true" stopprocessing="true"> <match url=".*" /> <conditions> <add input="{http_host}" pattern="^[^\.]+\.[^\.]+$" /> </conditions> <action type="redirect" url="http://www.{http_host}/{r:0}" /> </rule> </rules> </rewrite> </system.webserver>
Comments
Post a Comment