使用phpstudy时
tp5中的官方说明是在入口文件的同级目录下添加一个.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>
这个配置在phpstudy下没有生效
在phpstudy下.htaccess文件里面的内容应该改成:
<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>