gpt4 book ai didi

apache设置自动将http跳转到https的方法

转载 作者:qq735679552 更新时间:2022-09-29 22:32:09 36 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章apache设置自动将http跳转到https的方法由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

复制代码 代码如下:

<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的方法的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com