apache设置自动将http跳转到https的方法
2018-10-12 13:53
901 查看
<Directory "/opt/fivetrees">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All #这里原先是None要改为All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
首先,在网站根目录下创建.htaccess文件,在最下面添加写入如下语句:
RewriteEngine on
RewriteBase / #我这行是没有配置
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
您可能感兴趣的文章:
相关文章推荐
- Apache下设置自动将http跳转到https方法
- Apache 多种方法设置HTTP页面自动跳转到HTTPS
- apache如何设置http自动跳转到https
- apache如何设置http自动跳转到https
- IIS服务器设置http自动跳转https方法
- 设置Apache下HTTPS 自动跳转为 HTTP
- Apache由http自动跳转到https的方法
- apache服务器怎么设置http自动跳转到https
- Apache由http自动跳转到https的多种方法
- 阿里云服务器Apache环境下搭建HTTPS环境并且设置http自动跳转到https
- tomcat设置https访问(http自动跳转到https)
- tomcat设置http自动跳转为https访问
- 服务器安全升级:ssl证书配置好,设置http跳转https的几种方法
- http自动跳转https的配置方法
- tomcat设置http自动跳转为https访问
- tomcat设置http自动跳转为https访问(转)
- IIS 设置HTTP页面自动跳转到HTTPS
- tomcat设置http自动跳转为https访问
- tomcat设置http自动跳转为https访问
- apache上http自动跳转https