修改根目录.htaccess文件
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
#thinkphp去掉index.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
#http自动跳转到https
RewriteCond %{SERVER_PORT} !^443$
#只有匹配对应的域名才会跳转
RewriteCond %{SERVER_NAME} ^hrsc.cc|www.hrsc.cc$
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R]
</IfModule>
原文地址:http://blog.51cto.com/keefe/2069936
时间: 2024-10-09 11:12:43