apache_conf 强制https

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf 强制https相关的知识,希望对你有一定的参考价值。

# -----------------------Force https----------------------------------------------------------
RewriteEngine On
# This will enable the Rewrite capabilities

RewriteOptions InheritDownBefore
# This prevents the rule from being overrided by .htaccess files in subdirectories.

RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS

RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [QSA,R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e.  http://www.example.com/foo/ to https://www.example.com/foo/
# ----------------------\Force https----------------------------------------------------------

以上是关于apache_conf 强制https的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf 强制https

apache_conf 强制https通用

apache_conf 强制Https

apache_conf Apache - 强制HTTPS

apache_conf .htaccess强制https

apache_conf 使用.htaccess强制HTTPS