Apache禁用单个目录php权限如下:
<Directory "/website/attachments">
php_flag engine off
</Directory>
或者
<Directory "/website/attachments">
<Files ~ ".php">
Order allow,deny
Deny from all
</Files>
</Directory>
Nginx禁用单个目录php权限如下:
location /upload/ {
location ~ .*\.(php)?$
{
deny all;
}
}
Nginx禁用多个目录php权限如下:
location ~* ^/(upload|images)/.*\.(php|php5)$
{
deny all;
}
Lighthttpd禁用多个目录php权限如下:
$HTTP[“url”] =~ “^/(forumdata|templates|customavatars?)/” {
fastcgi.server = ()
}
Apache:
<Location “/forumdata”>
php_admin_flag engine off
Options -ExecCGI
AddType text/plain .html .htm .shtml .php
</Location>
apache禁止目录的php权限
本原创文章未经允许不得转载 | 当前页面:蒙面人生 » apache禁止目录的php权限