phpstudy2018 apcha设置隐藏index.php

thinkphp5默认设置的.htaccess文件实现了去掉(隐藏)index.php的功能,但是在phpstudy(apache)中运行thinkphp5时却无法正常去掉index.php,错误的原因是在phpstudy中thinkphp5官方的.htaccess文件无效,解决办法如下:

修改.htaccess文件中的:

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

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

猜你喜欢

转载自blog.csdn.net/qq_28404381/article/details/90036000