关于tp5自动过滤index.php

Posted Cc_Pz

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于tp5自动过滤index.php相关的知识,希望对你有一定的参考价值。

在public/.htaccess 中输入这段代码即可实现过滤index.php

 

1 <IfModule mod_rewrite.c>
2   Options +FollowSymlinks -Multiviews
3   RewriteEngine On
4 
5   RewriteCond %{REQUEST_FILENAME} !-d
6   RewriteCond %{REQUEST_FILENAME} !-f
7   #RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
8   RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
9 </IfModule>

 

以上是关于关于tp5自动过滤index.php的主要内容,如果未能解决你的问题,请参考以下文章