[英]Restrict download of .htaccess and web.config files
我面臨一個問題。 當我在網站URL之后輸入.htaccess或web.config時,它將下載.htaccess或web.config文件。 (例如http://localhost/.htaccess )。 我正在嘗試限制下載,但不幸的是未成功。 我嘗試將600授予.htaccess權限,但仍被下載。
在應執行此工作的ngix服務器上。 這部分代碼需要定義其余服務器和位置塊的位置
location ~ /\.htaccess {
deny all;
return 404 http://where_ever_you_want/and/so/on;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.