在根目錄下添加文件 .htaccessphp
<IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f #若是頁面出現"No input file specified." 請註釋第一條,啓用第二條 RewriteRule ^(.*)$ $1.php [QSA,PT,L] #RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] #RewriteRule ^(.*)$ index.php [E=PATH_INFO:$1,QSA,PT,L] </IfModule>