thinkphp 访问路径如何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]
</IfModule>

修改为

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

主要是把

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] 修改为 RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

文章来自 www.96net.com.cn

posted @ 2023-03-01 21:59  学无边涯  阅读(93)  评论(0编辑  收藏  举报