Warning: Undefined variable $kind in /home4/wgate/public_html/include/checkfunpdo.php on line 662

Warning: Undefined variable $vers in /home4/wgate/public_html/include/checkfunpdo.php on line 662

Warning: Undefined variable $kind in /home4/wgate/public_html/include/checkfunpdo.php on line 662

Warning: Undefined variable $vers in /home4/wgate/public_html/include/checkfunpdo.php on line 662
:::| 目前位置圖示目前位置:首頁圖示回首頁 | 主功能頁圖示相關問答
圖片目錄限制該目錄不可執行PHP

[日期]:2023/01/18  [瀏覽人數]:597

程式有時會提供上傳附件功能,為防止該目錄被上傳PHP檔可以做設定來限制

1.apache 24 若該目錄有設定AllowOverride None,將這個改為AllowOverride All,才能開放由.htaccess設限制功能。

2.在要限制的目錄新增.htaccess檔,內容設定如下:

php_flag engine off
<Files ~ "\.(js|php|jsp|php4|php3|php5)">
Order allow,deny
Deny from all
</Files>