htaccess禁止php,htm
php_flag engine off
代码如下 | 复制代码 |
<Files ~ ".php"> order allow,deny deny from all </Files> <Files ~ ".htm"> <Files ~ ".html"> <FilesMatch (.*).htm$> <FilesMatch (.*).html$> |
在apache中直接定义
代码如下 | 复制代码 |
<Directory /usr/local/apache/htdocs/bbs/data> php_flag engine off </Directory> <Directory ~ "^/home/centos/web/data"> <Files ~ ".php"> Order allow,deny Deny from all </Files> </Directory> |
nginx
代码如下 | 复制代码 |
location /data/ { location ~ .*.(php)?$ { deny all; } } |
时间: 2024-09-08 18:32:40