G
G
gulitsky2015-09-11 06:26:09
ASP.NET
gulitsky, 2015-09-11 06:26:09

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

1 answer(s)
G
gulitsky, 2015-09-11
@gulitsky

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>

and in html where we will connect static files, we write
baseurl in the head, it seems like it will have to be removed, it’s just that intelsight works to select files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question