新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
apache設(shè)置自動(dòng)將http跳轉(zhuǎn)到https的方法
復(fù)制代碼代碼如下:
#
# 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
首先,在網(wǎng)站根目錄下創(chuàng)建.htaccess文件,在最下面添加寫入如下語句:成都服務(wù)器托管
復(fù)制代碼代碼如下:
RewriteEngine on
RewriteBase / #我這行是沒有配置
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
網(wǎng)站標(biāo)題:apache設(shè)置自動(dòng)將http跳轉(zhuǎn)到https的方法
分享網(wǎng)址:http://www.ef60e0e.cn/article/dphss.html