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

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

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

2024-08-27 18:23:18
字體:
供稿:網(wǎng)友
客戶中心啟用了https的ssl證書,現(xiàn)在需要將原先的http直接跳轉(zhuǎn)到https上。這里為大家提供一個我經(jīng)常使用到的方法,即使用偽靜態(tài)功能

復(fù)制代碼 代碼如下:
<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文件,在最下面添加寫入如下語句:

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

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 丰城市| 青神县| 玛纳斯县| 海安县| 凌源市| 左云县| 桃源县| 攀枝花市| 女性| 达日县| 礼泉县| 吉隆县| 延吉市| 平凉市| 林州市| 南皮县| 正蓝旗| 海兴县| 女性| 阆中市| 新河县| 连江县| 颍上县| 横峰县| 新竹市| 泽库县| 信宜市| 丘北县| 砀山县| 定远县| 含山县| 灌南县| 共和县| 浠水县| 淄博市| 合山市| 新河县| 闽侯县| 墨竹工卡县| 卓尼县| 凉山|