IIS does not use URL redirection to fix HTTP force jump to HTTPS

Source: Internet
Author: User

Requirements: Before this, the certificate is considered to be installed, and the default HTTP is normally accessed by default.

Idea: Since the choice requires SSL hint 403 error, then why not in the 403 error page plus Force JS by http to https le?


1, installation certificate (not the focus of this article, please search engine self-search)

2. "Edit Bindings"-"Add"-"https" and select "Certificate" (others do not need to be modified)

3. "SSL Settings" and "Require SSL" + client certificate "Ignore"

4, now direct access 80 will prompt 403 error

5. Find 403 error page, my in (C:\inetpub\custerr\zh-CN\403.htm), edit open, add in

<script type= "Text/javascript" > var url=window.location.href; Url=url.replace ("http:", "https:") window.location.replace (URL);</script>

6, input without HTTPS will first jump to 403 error page, in the jump to the HTTPS//{HTTP_HOST}/XXX page!


Thank you


IIS does not use URL redirection to fix HTTP force jump to HTTPS

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.