TP5之URL重写(多个规则)

浏览:5972 发布日期:2017/09/10 分类:ThinkPHP5专区 关键字: TP5URL重写 rewriterule htaccess重定向语法:
https://www.kancloud.cn/manual/thinkphp5/177576 --部署-URL重写,隐藏index入口文件。
规则如下:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>

我想把http协议改为https,证书什么的都弄好了,重定向的配置文件错了
Http 重定向到https

RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !^/tz.PHP
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R]
怎么把这两个合并呢? 我试着看了下rewriterule htaccess重定向语法,但是试了下不太灵光..
我改写成了
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on

RewriteCond %{SERVER_PORT} !^443$

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ https://%{SERVER_NAME}/index.php?/$1 [R,L]
</IfModule>
但是在跳转的时候 会产生BUG 一部分路径无法识别了。 大家有没有碰到过,求指教
最佳答案
评论( 相关
后面还有条评论,点击查看>>