关于tp5自动过滤index.php

时间:2023-03-08 22:41:04
关于tp5自动过滤index.php

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

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