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

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -