Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bjørn Fridal 274 posts 784 karma points
    Dec 16, 2009 @ 20:31
    Bjørn Fridal
    0

    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:

    No umbraco document matches the url 'http://domain.com/2009.aspx'
    umbraco tried this to match it using this xpath query'2009')

    Has anyone come across this?

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Dec 16, 2009 @ 22:54
    Morten Bock
    0

    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".

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Dec 16, 2009 @ 23:12
    Douglas Robar
    1

    @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.

  • Bjørn Fridal 274 posts 784 karma points
    Dec 17, 2009 @ 10:03
    Bjørn Fridal
    0

    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. 

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Dec 17, 2009 @ 19:01
    Morten Bock
    0

    Good point bjawnie. Add it to Codeplex as a suggestion.

  • Bjørn Fridal 274 posts 784 karma points
    Dec 21, 2009 @ 18:15
  • Stephan Lonntorp 195 posts 212 karma points
    Dec 22, 2009 @ 09:40
    Stephan Lonntorp
    0

    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.

  • webangelo 107 posts 190 karma points
    Apr 21, 2011 @ 05:15
    webangelo
    0

    One more workaround to add to this old discussion.  Setting umbracoUseDirectoryUrls to true in the web.config seems to work as well.

Please Sign in or register to post replies

Write your reply to:

Draft