0

I have the following 2 lines in my global.asax

routes.MapRoute("myTest1", "test", new { 
   controller = "Home", action = "Page", id = "Home" 
});
routes.MapRoute("myTest2", "test.html", new {
   controller = "Home", action = "Page", id = "Home" });

The first line above works perfectly, and both lines work when testing locally. The problem comes when putting this on my live server. The second line goes to a 404, as does any other that ends with .html

I really don't understand why it works locally, yet not online.

Any advice would be great. Thanks

--- EDIT ---

I have looked in IIS but i'm not sure the problem lies there. I tried uploading a html file "test.html" and the page loads perfectly even though its set to redirect.

tereško
  • 58,060
  • 25
  • 98
  • 150
Karl Humphries
  • 328
  • 1
  • 4
  • 15

1 Answers1

0

The problem Is with the way dots are treated in general. Have a look at these two related posts.

ASP.NET MVC Url Route supporting (dot)

Routing on IIS6 With Decimal In Route

Community
  • 1
  • 1
Johann Strydom
  • 1,482
  • 14
  • 18
  • Thank you, this seems to make a lot of sense, however I now have a 500 error instead of a 404. So it has done something, but unsure what... – Karl Humphries Nov 26 '12 at 14:59