Using a wwwroot folder (ASP.NET Core style) in ASP.NET 4.5 project

后端 未结 3 1242
-上瘾入骨i
-上瘾入骨i 2020-12-01 05:44

I quite like the approach of the new asp.net (asp.net 5\\core 1.0) web apps with the wwwroot folder being the root and only static files in there being served up.

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 06:15

    If you would like to use IIS for this you can create a rewrite rule:

    
        
          
            
              
              
            
          
        
      
    

    You can also add a prefix to the url regex, such as ^(wwwroot|api)/.*, if this is a web-api that you would like to host at /api.

提交回复
热议问题