国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > Apache > 正文

apache設(shè)置自動將http跳轉(zhuǎn)到https的方法

2024-08-27 18:27:56
字體:
供稿:網(wǎng)友

代碼如下:
<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>

首先,在網(wǎng)站根目錄下創(chuàng)建.htaccess文件,在最下面添加寫入如下語句:

代碼如下:
RewriteEngine on
RewriteBase / #我這行是沒有配置
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 惠安县| 神农架林区| 河源市| 永城市| 高邮市| 黄陵县| 盐池县| 通化县| 兴山县| 城口县| 阳西县| 湘西| 建湖县| 安远县| 林口县| 敖汉旗| 金平| 万宁市| 浙江省| 茌平县| 井陉县| 日照市| 三门县| 綦江县| 呼和浩特市| 唐山市| 克拉玛依市| 东兰县| 介休市| 巴林右旗| 东海县| 潜山县| 陇南市| 重庆市| 聂拉木县| 景东| 天津市| 广昌县| 汝州市| 阿城市| 兰西县|