×

删除thinkphp8路径的index.php

kjtoday kjtoday 发表于2025-09-25 13:00:25 浏览12 评论0

抢沙发发表评论

<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>


在项目public文件夹下新建.htaccess

粘贴上面的代码

这里要注意

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

这行的index.php/有时候很多服务器会解析不了

要改成index.php?