[英]Deny Folder and direct link access in .NET MVC
我在Web.config文件中有以下代碼
<location path="UserContent">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
它拒絕訪問指定的文件夾和子文件夾,但是仍然可以直接鏈接訪問文件。 我該如何解決?
謝謝
將此添加到<system.webServer>
<security>
<requestFiltering>
<hiddenSegments>
<add segment="UserContent"/>
</hiddenSegments>
</requestFiltering>
</security>
這將防止任何人訪問文件夾,子文件夾和靜態文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.