I have an ASP.NET MVC site and it works fine when I run it locally. As soon as I deploy this site in IIS 7, all links to resources are broken (i.e. script files, images, css files). Could this be a route issue or would it be an IIS setup?
Here are my routes:
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("elmah.axd"); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Search", "Basic/Page/{page}", new { controller = "Search", action = "Basic" } ); routes.MapRoute( "Default",
EDIT:
I reference all content using the T4MVC template. The pattern is correct if it sets paths with ~ / content /. The problem is that when html is generated, "~" is not included in the output, it is simply / content /.
<img src="<%= Links.Content.Images.logo_png %>" alt="Logo" /> <img src="/Content/Images/logo.png" alt="Logo" />
Note:
The problem is that something is wrong with this line in web.config. It turns out that January 1, 2011 is not Friday, but Saturday. For some reason, I still didn't like this line.
<clientCache httpExpires="Fri, 1 Jan 2011 15:30:00 UTC" cacheControlMode="UseExpires"/>
Changing this to this works fine;
<clientCache cacheControlMode="UseExpires" httpExpires="Tue, 19 Jan 2038 03:14:07 GMT" />
Add it here in the hope that it will help others solve this problem.
Thanks!
source share