Using the below code in web.config you can force the website URL to always use WWW.
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to WWW" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^mysite.com$" />
</conditions>
<action type="Redirect" url="http://www.mysite.com/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
Tuesday, August 6, 2013
Force website URL to use WWW in ASP.NET
Subscribe to:
Post Comments (Atom)
No comments:
Write comments