博客

apache隐藏入口文件

2016-08-24 14:39:26浏览(3307)作者:itnoob 来源:本站原创

apache隐藏入口文件index.php

1、去掉httpd.conf 中 #LoadModule rewrite_module modules/mod_rewrite.so  前的“#”

2、AllowOverride none 改成 AllowOverride all

LoadModule rewrite_module modules/mod_rewrite.so 

<Directory />   	 
    AllowOverride all	 
    Require all denied   	 
</Directory>

3、在应用入口文件同级目录添加.htaccess文件,内容如下:

<IfModule mod_rewrite.c>
    Options +FollowSymlinks -Multiviews
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>


标签:rewrite,隐藏入口,apache