apache_conf 使用.htaccess强制HTTPS

Posted

tags:

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

RewriteEngine On

# If we receive a forwarded http request from a proxy...
RewriteCond %{HTTP:X-Forwarded-Proto} =http [OR]

# ...or just a plain old http request directly from the client
RewriteCond %{HTTP:X-Forwarded-Proto} =""
RewriteCond %{HTTPS} !=on

# Redirect to https version
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

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

apache_conf 使用.htaccess强制下载文件

apache_conf 如何使用.htaccess文件强制HTTPS

apache_conf 在htaccess中强制使用HTTPS和WWW

apache_conf .htaccess强制https

apache_conf 强制www。 (htaccess的)

apache_conf .htaccess - 强制文件在浏览器中下载