HTTP Jump HTTPS third article

Source: Internet
Author: User
Tags builtin

Tag: nbsp Represents the Connect Write Virtual/etc/tin server configuration

First, Implementing Access http jump HTTPS access (http one-way authentication)

① Modifying a configuration file

# vim/etc/httpd/conf/httpd.conf

added at the end of the file

<ifmodule ssl_module>

Sslrandomseed startup Builtin : Perform built-in functions ; internal key Directive

Sslrandomseed Connect Builtin

domain Jump

</IfModule>

Rewriteengine on

Rewritecond%{server_port}!^443$

Rewriterule (. *) https://%{server_name}/$1 [R]

: Rewrite condition, service port, not 443 set

: Rewrite rules , . * indicates that the next test is arbitrary,R is replaced, and replaced by https://% {server_name}

IP Jump

Listen 80

<virtualhost *:80>

ServerName Web

documentroot/var/www/html/

Add rewriteengine on

Add rewritecond%{server_port}!^443$

Add rewriterule ^ (. *) $ https://%{http_host}$1 [R]

</VirtualHost>

② from the service

# Service httpd Restart

③ client-side test : access to http jumps directly to HTTPS


HTTP Jump HTTPS third article

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.