Answer the question
In order to leave comments, you need to log in
How to make an analogy of the wwwroot directory in ASP.NET MVC 5?
I really liked the wwwroot directory in mvs 6, just what was previously lacking in previous versions. Is it possible to make a request to the root but to wwwroot when accessing static files, in general, is it possible to make an analogy in earlier versions of MVS?
Answer the question
In order to leave comments, you need to log in
found a way, maybe someone knows better
, we prescribe this in the web.config, inside<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="wwwroot/index.html" />
</files>
</defaultDocument>
<rewrite>
<rules>
<rule name="Static Files" stopProcessing="true">
<match url="^(.*)\.(html|js|css|jpeg|jpg|gif|png)$" />
<action type="Rewrite" url="/wwwroot/{R:1}.{R:2}" appendQueryString="true" redirectType="Found" />
</rule>
</rules>
</rewrite>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question