我在我的网站中添加了一条路线,以允许站点地图,并且在IIS7中一切工作正常,但是一旦我部署了路线,它就停止工作了。由于Live服务器正在运行iis6,我需要在for.xml中放置一个新的映射,以供.net处理,然后它开始工作。
不过,我的问题现在出现在网站上的其他所有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 = "" }
);