tp6省略url里的index.php

apache环境下,修改public下的.htaccess文件

加个问号就行了

代码如下:

<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>
原文地址:https://www.cnblogs.com/chenyingying0/p/13604383.html