I am creating a website, with Umbraco 4.0.3, that has got some content categories by year. My documents have names like 2009, 2010 but when I try to access them I get the following error:
No umbraco document matches the url 'http://domain.com/2009.aspx' umbraco tried this to match it using this xpath query'2009')
Hmm, this might be a double effect. Umbraco can recognize a node by it's ID as a url. So if your node has id 1234, you could access it through /1234.aspx
So Umbraco be trying to find a node with the ID = 2009, instead of one with the name "2009".
@Morten, I think you're right. Not sure how that might be changed. But, a few observations and potential workarounds for bjawnie...
1. As long as the numeric-only node is not directly under the root of the site it will be okay... example.com/blog/2009.aspx is okay.
2. Add any kind of non-numeric character to the url (including a hyphen, letter, underscore, etc.) and it will work properly... example.com/2009-.aspx is okay.
3. Create a 'not found' handler and add some logic to look up the page name and use it.
4. Create a url rewrite rule and always include some extra text you'll remove from the visible url. This won't work with the NiceUrl() function but it will work as a last resort if you can't use a better option.
5. ... anyone else have any ideas for workarounds?
I made a workaround where I put my numeric nodes into a category domain.com/content/2009.aspx It works and its fine for me.
I am thinking that there ought to be a warning message when you save a document with an all numeric name and no parent nodes that will be included in the URL.
you can also try to set <add key="umbracoHideTopLevelNodeFromPath" value="false" /> in web.config, as only top level urls that are numeric-only seems to fail in this manner.
Numeric URLs doesn't work? (Umbraco 4.0.3)
Hi,
I am creating a website, with Umbraco 4.0.3, that has got some content categories by year. My documents have names like 2009, 2010 but when I try to access them I get the following error:
Has anyone come across this?
Hmm, this might be a double effect. Umbraco can recognize a node by it's ID as a url. So if your node has id 1234, you could access it through /1234.aspx
So Umbraco be trying to find a node with the ID = 2009, instead of one with the name "2009".
@Morten, I think you're right. Not sure how that might be changed. But, a few observations and potential workarounds for bjawnie...
1. As long as the numeric-only node is not directly under the root of the site it will be okay... example.com/blog/2009.aspx is okay.
2. Add any kind of non-numeric character to the url (including a hyphen, letter, underscore, etc.) and it will work properly... example.com/2009-.aspx is okay.
3. Create a 'not found' handler and add some logic to look up the page name and use it.
4. Create a url rewrite rule and always include some extra text you'll remove from the visible url. This won't work with the NiceUrl() function but it will work as a last resort if you can't use a better option.
5. ... anyone else have any ideas for workarounds?
cheers,
doug.
Hi,
Thanks for the ideas.
@Morten. Yes I think you nailed it.
I made a workaround where I put my numeric nodes into a category domain.com/content/2009.aspx It works and its fine for me.
I am thinking that there ought to be a warning message when you save a document with an all numeric name and no parent nodes that will be included in the URL.
Good point bjawnie. Add it to Codeplex as a suggestion.
Codeplex link: http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=25741
you can also try to set <add key="umbracoHideTopLevelNodeFromPath" value="false" /> in web.config, as only top level urls that are numeric-only seems to fail in this manner.
One more workaround to add to this old discussion. Setting umbracoUseDirectoryUrls to true in the web.config seems to work as well.
is working on a reply...