How to serve of content files with “abnormal” file extensions in ASP.NET MVC
-
21-09-2019 - |
Question
So, I want to serve up some .ejs files (EJS templates.. see http://embeddedjs.com for more info) from my /Content or /Scripts folder in an ASP.NET MVC project.
This behavior doesn't seem to work out of the box. Is there a configuration-based solution to make this happen? I suppose this would apply to those wanting to serve any kind of "non-standard" static content out of ASP.NET MVC..
In my case it has to serve .ejs files (can't rename to .js) because the EJS framework looks for URLs ending in .ejs and, if the URL you provide has some other extension, it'll just attach .ejs to the end..
Thanks
Solution
404 with iis7 asp.mvc doc and pdf files in folder
That makes answer a duplicate, pretty much.. change *.bz2 to *.ejs and bob's your uncle.