I have a ASP.Net MVC 4.5 WebAPI controller (IIS8) that can serve static images files from a repository. The URLs I want to use are like;
http://example.com/blob/image/123412341324.jpg
The trouble is '.jpg' here appears to be going through the static file handler, which for the most part is what I want to keep. I don't want all static files to go through ASP.Net just the ones on this URL path.
Is there any way I can configure ASP.Net to serve up these files without runAllManagedModulesForAllRequests
and without modifying the url such as removing the file extension? Ideally, an IIS routing mechanism that looked at the folder path /blob/image/
;
http://example.com/blob/image/123412341324.jpg -- route through ASP.Net WebAPI
http://example.com/staticimages/123412341324.jpg -- do not route through ASP.Net
http://example.com/anywherelese/123412341324.jpg -- do not route through ASP.Net
I know I could write a separate 'IHttpHandler' but I'd like to route it through the MVC WebAPI controller if possible.