In the following example we will redirect HTTP to HTTPs using URL Rewrite:
Edit your web.config file.
Paste the following into it just above "</configuration>":
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Temporary" />
</rule>
</rules>
</rewrite>
</system.webServer>
Note adjust where required.
Most Popular Articles
Sending Email via C# and ASP.NET
Add the following to your web.config file: <system.net> <mailSettings>...
How do I enable detailed error messages in the web.config of my website?
Detailed Errors allows for debugging errors in your websites code. Without detailed errors...
ASP.NET Session Timeout
This in-depth analysis helps you know the problem and workaround when you experienced ASP.NET...
Can I use ASP.NET State Service?
ASP.NET state service is not enabled due to the fact on shared hosting it keeps the session alive...
Troubleshooting ASP.NET site
In most cases the error should display on the screen.However if it does not you can enable error...
