我在我的网站中添加了一条路由以允许站点地图,并且在IIS7中一切正常但是一旦我部署了路由就停止了工作。由于实时服务器运行的是IIS6,我需要为.xml添加一个新的映射,然后才能开始工作。
我的问题是现在网站上的每个其他xml文件。我在尝试查看xml文件时遇到404错误,但是sitemap.xml路由有效。这是路由问题还是IIS设置问题?
如果有帮助,这是我的路线
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 = "" }
);