I have a simple ASP MVC project. Under this site I need to show plain .html files, without treating routes as controller/action.
I have folder documentation with file index.html in it. I need to have this accessible under www.mydomain.com/documentation, it returns 403. Currently it works only under www.mydomain.com/documentation/index.html
I have added
routes.Ignore("developers/");
into RouteConfig.cs
and in Startup.cs
for OwinAppBuilder
app.UseStaticFiles();
What should I do to have it accessible under www.mydomain.com/documentation/index.html ?
In your route config add
In you web.config under
<system.webServer>/<handlers>
addTaken from this site if you want to read more about it.
Edit: note that the url in the
MapRoute
has the directoryPublic
in the url, as well as in thepath
for the web.config line. If your html file is not in a directory namedPublic
you will need to change that part to match your directory structure.