IIS、Apache、Nginx禁(jìn)止目錄執行php腳本方法
1. IIS實現方法
IIS比較簡單(dān),按圖中(zhōng)設置就可以了
2. Apache實現方法
方(fāng)法(fǎ)一
<Directory "/var/www/html/attachments">
<Files ~ ".php">
Order allow,deny
Deny from all
</Files>
</Directory>
方法二
<Directory "/var/www/html/attachments">
php_admin_flag engine off
</Directory>
方法三
在.htaccess中寫入
RewriteEngine on RewriteCond % !^$
RewriteRule attachments/(.*).(php)$ - [F]
3. Nginx實現方法
locations ~ /attachments/.*\.php$ {
deny all;
}
關鍵詞:IIS,Apache,Nginx,php腳本
閱讀本文後您(nín)有什麽(me)感想? 已有 人給出(chū)評價!
- 0
- 0
- 0
- 0
- 0
- 0