在本地phpstudy环境,根据官方文档https://www.kancloud.cn/manual/thinkphp5/177576进行URL重写,隐藏index.php不好用,百度方案,发现将.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>
第一种办法修改最后一句
RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
或者
RewriteRule ^(.*)$ index.php?$1 [QSA,PT,L]
查看 文档链接http://blog.csdn.net/fjnjxr/article/details/73873744