Copied to clipboard

Flag this post as spam?

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


  • Matt Stueve 30 posts 49 karma points
    Jan 05, 2011 @ 02:39
    Matt Stueve
    0

    umbracoUrlAlias only works when lower-case?

    I have created a navigation control that sets links to the URL for pages equal to the umbracoUrlAlias value if it exists and NiceUrl() if it doesn't.  In the process I noticed that a lot of the links to umbracoUrlAlias values were throwing 404s.  A link to a page's umbracoUrlAlias value that contains any capital letters will throw a 404.  However, if I set the umbracoUrlAlias value to be all lower-case, it works.

    Is this a known bug?  Is there a fix?  I'm using Umbraco 4.5.2.

    Thanks,
    Matt

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 05, 2011 @ 08:03
    Dirk De Grave
    0

    it's by design, all url's are saved as lowercase and xpath queries to find a document (such as the FindByAlias not found handler) will try to do an exact match on the document's property (umbracoUrlAlias)

     

    Can it be fixed? Probably so, as it's just a matter of upper- or lower casing the request before doing the actual xpath query. If you'd like to have this included in the core, add a work item on Codeplex and vote for it.

     

    Meanwhile, you could lower case your alternate url, or if you're not sure whether editors will be able to do so, write an event handler on save of a document and rewrite the alternate url to lowercase.

     

    Hope this helps.

    Regards,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft