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

首頁 > 網站 > 建站經驗 > 正文

apache設置自動將http跳轉到https的方法

2019-11-02 16:06:22
字體:
來源:轉載
供稿:網友

復制代碼 代碼如下:

<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]

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 拉孜县| 东台市| 金堂县| 枣强县| 武平县| 许昌县| 深州市| 渭源县| 南开区| 盐亭县| 济阳县| 南昌市| 固镇县| 宣武区| 阳朔县| 乌审旗| 天津市| 门头沟区| 芦溪县| 贵溪市| 崇义县| 舒兰市| 定远县| 普宁市| 金阳县| 绥阳县| 太和县| 新竹县| 永川市| 新郑市| 福清市| 和平区| 漳浦县| 军事| 临泉县| 台山市| 湟源县| 楚雄市| 西畴县| 个旧市| 张家界市|