apache怎么配置禁止访问index.php以外的php文件
1、在apache中web目录下,新建index.php,other.php 可以发现都可以访问


2、在web目录下新建文件(.htaccess),加入以下内容:
RewriteEngine on
RewriteRule ^(.*)$ index.php/$1 [L]
3、修改http.conf,支持rewrite_module:
LoadModule rewrite_module modules/mod_rewrite.so

4、修改http.conf,修改AllowOverride None 为 AllowOverride All,配置文件中有多个AllowOverride,请注意AllowOverride的上下文。


5、重启apache:
/usr/local/httpd/bin/apachectl restart
使用浏览器访问other.php

阅读量:120
阅读量:129
阅读量:23
阅读量:73
阅读量:142