图片上传目录,尤其是公共的上传目录应该禁止执行可执行文件使用以下方法
apache
.htaccess
1 2 3 4 | # Block executables < FilesMatch "\.(php|phtml|php3|php4|php5|pl|py|jsp|asp|html|htm|shtml|sh|cgi|suspected)$"> deny from all </ FilesMatch > |
nginx
1 2 3 4 5 6 7 | location /media/ { ...... # Banned locations location ~* (\.php$|\.phtml$|\.htaccess$|\.git) { deny all; } } |
请登录已经激活账号继续浏此文章所有内容!