Is there a way to give an ASP.NET MVC 4 project a “public” folder, which would act like the application root, like in Ruby on Rails?
ASP.NET MVC usually comes with a “Content” folder where you can put statically served files like style sheets, scripts, and images. But the URLs for these files have to include the Content folder, for example <img src="/Content/logo.png">.Is it possible to make the Content folder the root of the application so you can use this instead: <img src="/logo.png">?
I’m not sure why I didn’t think of this before, but I was able to accomplish this with IIS URL Rewrite. The following rules assume a folder named “Public” where your static files reside. Of course, you can name the folder whatever you want.