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
Related Posts
Server object: 006~ASP 0178~Server.CreateObject Access Error~The call to Server.CreateObject failed while checking permissions. Access is denied to this object.
How to use a common class to check user session is still valid in ASP.NET web pages
C# FTP file processing helper class
How to use log4net in a ASP.NET Web Application
Subscribe to:
Post Comments (Atom)