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>

 

posted @ 2019-01-31 10:58  思如雨  阅读(2363)  评论(0编辑  收藏  举报