开发者

Xml files stop being served by IIS6 after allowing .net to process the .xml extension

开发者 https://www.devze.com 2023-01-01 07:25 出处:网络
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 mappin

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 开发者_JAVA百科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 = "" }
);


The issue is that by default IIS 6.0 does not support extensionless routes. Here's an article that should help you solve the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消