how to deny user to access sub folders and file?

前端 未结 2 765
盖世英雄少女心
盖世英雄少女心 2020-12-18 19:57

on local machine ,i created sample project on mvc4 (razor) and create directory named \"x\" and put a text file \"a.txt\" in it.

http://localhost:64471/x/a.t         


        
2条回答
  •  误落风尘
    2020-12-18 20:23

    I tested with path="x" in root web.config. It restrict everything under x folder; it won't even let me browse ~/x. I get redirected to login page.

    Could you try full path to a.txt like this in root web.config?

    
      
        
          
        
      
    
    

    If it still doesn't work, you can try creating a web.config inside x folder with the following content.

    
    
    
      
        
          
            
          
        
      
    
    
    

提交回复
热议问题