配置.htaccess文件解决网站整体https跳转方法
发布日期:2021/3/9
我们在配置.htaccess文件解决网站整体https跳转方法.网站安装了SSL安全证书(举例:PHP网站),访问http时仅首页跳转到https。想要整站所有文件及文件夹跳转的话,需要在网站根目录配置文件.htaccess。文件内容如下:
<IfModule mod_rewrite.c>Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !^/tz.php
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R]
</IfModule>



