IIS Multi-site HTTPS encryption and automatic HTTP jump to HTTPS

Source: Internet
Author: User
Tags require
Modify the following file: IIS6.0 path: C:\WINDOWS\Help\iisHelp\common\403-4.htm
IIS7.0 above path: C:\inetpub\custerr\zh-CN\403.htm
To the following content
<HTML><HEAD><TITLE> This page must be viewed through the secure channel </TITLE>
<meta http-equiv= "Content-type" content= "text/html; Charset=gb2312″>
</HEAD><BODY>
<script type= "Text/javascript" >
var url = window.location.href;
if (Url.indexof ("https") < 0) {
url = url.replace ("http:", "https:");
Window.location.replace (URL);
}
</script>
</BODY></HTML>
Note: In IIS6, Site Properties-"Directory Security-" edit the "Require secure channel (SSL)" tick.
IIS7, 8, SSL Settings-"Require SSL" check.


URL Rewrite method:

Download install URL rewrite module: Microsoft URL Rewrite module

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

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

Asp. NET station can directly modify the Web. config (same as "6, IIS Configuration Diagram" effect), 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>



By default, one server's IIS can only bind one HTTPS, which is port 443.

To implement multiple sites that correspond to HTTPS, you can only change the IIS configuration

Address: C:\Windows\system32\inetsrv\config\applicationHost.config,

The default one site with one such configuration

<binding protocol= "https" bindinginformation= "*:443"/>

modified to:

<binding protocol= "https" bindinginformation= "*:443:www.baidu.om"/>

Remember that you need to modify each site that corresponds.

Finally, if the server can access the HTTPS outside the network does not have to consider the network firewall is not open 443 and whether the use of reverse proxy these.


Professional website Encryption Certificate (4.8 only): http://dianziren.taobao.com


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.