IIS7 IIS8 http automatically jumps to HTTPS (port 80 jumps to port 443)

IIS7 IIS8 http automatically jumps to HTTPS (port 80 jumps to port 443)

IIS7 needs to confirm whether the "URL REWRITE2" pseudo-static module is installed. If you have already installed it, you can skip it.

URL REWIRTE (pseudo-static module)

Download address: http://www.iis.net/downloads/microsoft/url-rewrite

Step 1: Select the site, "URL rewrite", if you install the English version, it should be [Url rewrite]

Step 2: Add a "Blank Rule"

Step 3: Add rules

Name: HTTPS

Matches URL pattern: (.*)

Add condition: Condition: {HTTPS} Mode: off

Action Type Selection: Redirect

Redirect URL: https://{HTTP_HOST}/{R:1}

Then save it

Final effect picture

Logical grouping in conditions

First refer to the logical grouping information in the figure above.

enter type model Whether to ignore case Remark
{HTTPS} Matches the pattern ^OFF$ YES This is used to match whether your request is HTTPS or HTTP
{HTTPS_HOST} Does not match pattern ^(localhost) YES If you are on localhost it will not redirect to SSL

Advanced version (directly add pseudo-static to web.config)

<?@xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

This is the end of this article about IIS7 IIS8 http automatically jump to HTTPS (port 80 jump to port 443). For more related content about http automatically jump to HTTPS, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Multiple ways to automatically switch from http to https in Apache
  • Configure Tomcat to use https and automatically redirect to https when accessing http
  • How to configure http to automatically redirect to https
  • Perfect solution to the problem that the browser automatically jumps to https when entering http

<<:  Use of Linux read command

>>:  How to solve the problem that mysql cannot be closed

Recommend

Ubuntu MySQL version upgraded to 5.7

A few days ago, the library said that the server ...

HTML mouse css control

Generally speaking, the mouse is displayed as an u...

Solve the Docker x509 insecure registry problem

After installing Docker, I encountered the x509 p...

The implementation process of long pressing to identify QR code in WeChat applet

Preface We all know that the QR codes in official...

Detailed example of mysql trigger usage

MySQL trigger syntax details: A trigger is a spec...

Detailed steps for smooth transition from MySQL to MariaDB

1. Introduction to MariaDB and MySQL 1. Introduct...

Using vue3 to imitate the side message prompt effect of Apple system

Table of contents Animation Preview Other UI Libr...

How to encapsulate axios in Vue

Table of contents 1. Installation 1. Introduction...

Introduction to HTML Chinese Character Encoding Standard

In HTML, you need to specify the encoding used by...

Difference between querySelector and getElementById methods in JS

Table of contents 1. Overview 1.1 Usage of queryS...

How to add conditional expressions to aggregate functions in MySql

MySQL filtering timing of where conditions and ha...

12 Laws of Web Design for Clean Code [Graphic]

Beautiful code is the foundation of a beautiful we...