0

I have a Content folder and i want all the html files inside the Content folder from getting accessed, so i added this line at the top of the RegisterRoutes() method in the RouteConfig.cs file as follows

 routes.IgnoreRoute("{folder}/{resource}.html");

but still i am able to access the file.

I even tried giving a static value like this

  routes.IgnoreRoute("Content/{resource}.html"); 

and like this

 routes.IgnoreRoute("Content/demo.html");

but still was able to access the file, am i missing some thing, how can i acheive this behaviour.

Lijin Durairaj
  • 4,910
  • 15
  • 52
  • 85
  • 1
    Perhaps IIS is serving up the html pages without going through your application at all? – Ryan Searle Dec 01 '16 at 12:24
  • so how to get the desired result, according to the documentation IgnoreRoute wii ignore the specified file, then why is it not working, what am i doing wrong – Lijin Durairaj Dec 01 '16 at 12:26
  • What I'm suggesting is that perhaps your MVC application doesn't even come into the equation, check your IIS settings and see if it will serve up html pages itself. – Ryan Searle Dec 01 '16 at 12:29

0 Answers0