U4-9567 - Unable to Route XML Sitemap (with Extension) with Content Finder

Created by Nicholas Westby 24 Feb 2017, 23:23:42 Updated by Nicholas Westby 26 Apr 2017, 16:24:20

Relates to: U4-5445

Relates to: U4-6505

I think the issue arises because of this: http://issues.umbraco.org/issue/U4-5445#comment=67-16816

Apparently, Umbraco will ignore URL's that have extensions, unless the extension happens to be ".aspx", ".ashx", ".asmx", ".axd", or ".svc".

That list of file extensions is hard code here in the IsClientSideRequest function: https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Core/UriExtensions.cs#L147

I could probably create an XML sitemap without an XML extensions, but I'd like to stick to the common standards. I am also able to get this working by creating a URL rewrite, but then the XML sitemap name is less dynamic (i.e., I need to decide on it ahead of item so I can hardcoded it as a rewrite rule).

My initial thought is that there should be some way to bypass this functionality. For example, configure extra extensions. Or, allow for a custom function to be called that indicates whether or not a URL is "client side".

An example URL would be "site.com/sitemap.xml". Umbraco 7.5.10.


Sebastiaan Janssen 25 Feb 2017, 08:03:40

You should be able to use the umbracoReservedUrls key in web.config to add ~/sitemap.xml to the list. Make sure to re-open this issue if that doesn't work!

Nicholas Westby 25 Feb 2017, 18:53:55

@sebastiaan Good to know that's an option, but it doesn't happen to be an option in the current situation I'm working with. I actually have many sitemap files (e.g., "en-us/sitemap.xml", "en-ca/sitemap.xml"). One for each culture, and cultures can be added with content entry, so I can't know them in advance.

One potential solution would be the ability to add URL's to umbracoReservedUrls at runtime.

Nicholas Westby 26 Apr 2017, 16:16:48

@sebastiaan FYI, I had a chance to test the umbracoReservedUrls in the latest 6.x version of Umbraco (6.2.6) and it did not work. Changing the path to /xml-sitemap did work.

Priority: Normal

Type: Bug

State: Reopened


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.5.10

Due in version:


Story Points: