htaccess文件規(guī)則301和http跳轉(zhuǎn)https設(shè)置
2019-04-06 19:15:52
20740
.htaccess文件設(shè)置如下:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^m.lncdfzh.com.cn [NC]
RewriteRule ^(.*)$ http://m.lncdfzh.com.cn/$1 [L,R=301]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
301跳轉(zhuǎn)設(shè)置使用著兩行代碼
RewriteCond %{HTTP_HOST} ^m.lncdfzh.com.cn [NC]
RewriteRule ^(.*)$ http://m.lncdfzh.com.cn/$1 [L,R=301]
http跳轉(zhuǎn)https,使用著兩行代碼
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]