apache_conf 使用.htaccess将您的站点移动到SSL

Posted

tags:

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

# Moving your whole site to SSL

# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 
# Now, rewrite any request to the wrong domain to use www.
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]



# Excluding some pages from SSL

# Exceptions for HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{QUERY_STRING} !^option=com_obrss&task=feed&id=1

以上是关于apache_conf 使用.htaccess将您的站点移动到SSL的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf 使用.htaccess强制HTTPS

apache_conf 使用.htaccess强制HTTPS

apache_conf 使用.htaccess强制下载文件

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

apache_conf 使用这些.htaccess添加更安全的WordPress

apache_conf 使用.htaccess锁定WordPress仪表板登录