Deny access to html page

前端 未结 1 1911
刺人心
刺人心 2020-12-21 08:10

I have ASP.NET Web Forms project. I created a folder Demo in this project and put in this folder HelloWorld.html. I need deny access to this

1条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-21 08:43

    Your web.config is correct. The problem is this secures files that are going through the ASP.NET pipeline. Certain static files, like html files, are served up directly by IIS and so it is bypassing your security.

    You can force static files to go through the ASP.NET pipeline by adding a handler for them under the section of your web.config:

    
        
    
    

    0 讨论(0)
提交回复
热议问题