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

How to set up Referer in Nginx to prevent image theft

If the server's images are hotlinked by other...

Analysis of the difference between bold <b> and <strong>

All of us webmasters know that when optimizing a ...

Vue implements image drag and drop function

This article example shares the specific code of ...

Summary of situations where MySQL indexes will not be used

Types of Indexes in MySQL Generally, they can be ...

Example code for implementing the wavy water ball effect using CSS

Today I learned a new CSS special effect, the wav...

CSS+HTML to realize the top navigation bar function

Implementation of navigation bar, fixed top navig...

After reading the introduction of CSS box model, you will not be confused

The property names often heard in web design: con...

Quickly master the use of Docker to build a development environment

As the platform continues to grow, the project...

Commonplace talk about MySQL event scheduler (must read)

Overview MySQL also has its own event scheduler, ...

A brief discussion on JS prototype and prototype chain

Table of contents 1. Prototype 2. Prototype point...

CSS specification BEM CSS and OOCSS sample code detailed explanation

Preface During project development, due to differ...

Modify the jvm encoding problem when Tomcat is running

question: Recently, garbled data appeared when de...

MySQL Database Basics: A Summary of Basic Commands

Table of contents 1. Use help information 2. Crea...

How to add a column to a large MySQL table

The question is referenced from: https://www.zhih...

HTML elements (tags) and their usage

a : Indicates the starting or destination positio...