Automatic Redirect to HTTPS for web applications


This article applies to:

  • Trustwave SEG SQM and Web Console
  • SPE Administration and Customer Console

Question:

  • I want all connections to be over HTTPS. How can I redirect HTTP requests to HTTPS?

Procedure:

You can use the Microsoft IIS URL Rewrite 2.0 extension to redirect HTTP connections to HTTPS.

  1. Ensure that the site is accessible by both HTTP and HTTPS.
  2. Download and install the extension from http://www.iis.net/downloads/microsoft/url-rewrite.
  3. Create a rewrite rule for your site with values similar to the following image.
  4. Note that "ignore case" is unchecked for both the Match URL and the Conditions.



Notes:

If you prefer to add the rule manually, the information shown above translates to the following lines at the end of the system.webserver section of web.config:

<rewrite>
<rules>
<rule name="HTTPS redirect" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="false" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
</rule>
</rules>
</rewrite>

Last Modified 3/1/2020.
https://support.trustwave.com/kb/KnowledgebaseArticle19420.aspx