Xml files stop being served by IIS6 after allowing .net to process the .xml extension
- by Brian Surowiec
I added a route into my site to allow for a sitemap and everything worked fine in IIS7 but once I deployed the route stopped working. Since the live server is running IIS6 I needed to put a new mapping in for .xml to be processed by .net and then it started to work.
My issue though is on every other xml file on the site now. I keep getting a 404 error when trying to view xml files, but the sitemap.xml route works. Is this a routing issue or an IIS setup issue?
Here are my routes if it will help
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Gallery-Group-View",
"Projects/{groupId}",
new { controller = "Gallery", action = "GalleryList", groupId = "" });
routes.MapRoute(
"Gallery-List-View",
"Projects/{groupId}/{galleryId}",
new { controller = "Gallery", action = "GalleryView", groupId = "", galleryId = "" });
routes.MapRoute(
"Sitemap",
"Sitemap.xml",
new { controller = "XML", action = "Sitemap" }
);
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);