爲了之後方便查找,故記錄一下,也爲廣大網友提供一種解決辦法php
在項目根目錄下編寫一個.htaccess文件code
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] </IfModule>