apache 隐藏 index.php

在根目录下添加文件 .htaccess

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