iis7/iis7.5 URL overrides HTTP redirection to HTTPS _win server

Source: Internet
Author: User
Tags php and free ssl ssl certificate

1, have SSL certificate, or new purchase. Many free SSL certificates at the moment

2, Iis7/iis 7.5 under the binding HTTPS Web site

3. Download installation URL rewrite module: Microsoft URL Rewrite module

32 digits: Http://download.microsoft.com/download/4/9/C/49CD28DB-4AA6-4A51-9437-AA001221F606/rewrite_x86_zh-CN.msi

64 digits: Http://download.microsoft.com/download/4/E/7/4E7ECE9A-DF55-4F90-A354-B497072BDE0A/rewrite_x64_zh-CN.msi

4. Uncheck "SSL Settings"-"Require SSL"

5, ASP. NET station can modify Web.config directly (same as "6, IIS Configuration Diagram"), for example: see <rewrite>...</rewrite> node

<?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 >

6, IIS configuration diagram (graphical operation process, the same as the previous effect, applicable to asp/php and other stations)

Select the Web site you want to configure, such as:, find "url rewrite", No, look at the 3rd step above

Go to the URL rewrite module and click "Add Rule"

Select the blank rule

Name: HTTP to HTTPS redirect

Mode: (. *)

Conditional input: {HTTPS}

Mode: Off or ^off$

Or

REDIRECT Url:https://{http_host}/{r:1}

REDIRECT type: Found (302) or see other (303)

Or

"Apply" to the current site when the configuration is complete:

URL Rewrite configuration results:

This configuration is complete!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.