Nginx使用location
location ~ /(wp-content|uploads|wp-includes|images)/.*.(php|php5|js)$ { deny all; }
Apache方法
- Apache方法一(php_flag engine off #表示此目录下的PHP文件不被解释执行,限没有PHP权限)
php_flag engine off
- Apache方法二(文件目录自己设置)
directory
files
Order allow,deny
Deny from all