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