在根目录下添加文件 .htaccess
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#如果页面出现"No input file specified." 请注释第一条,启用第二条
RewriteRule ^(.*)$ $.php [QSA,PT,L]
#RewriteRule ^(.*)$ index.php/$ [QSA,PT,L]
#RewriteRule ^(.*)$ index.php [E=PATH_INFO:$,QSA,PT,L]
</IfModule>