Copied to clipboard

Flag this post as spam?

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


  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Feb 15, 2012 @ 15:33
    Lee Kelleher
    0

    altTemplate alias with trailing slash?

    On my Umbraco install I have "umbracoUseDirectoryUrls" set to true (so no ".aspx" extensions in the URLs).  When using an "altTemplate", it seems that they will only work when you don't have a trailing slash.

    Examples - these URLs do work:

     

    • /news/?altTemplate=rss
    • /news/rss

     

    This URL does not work:

     

    • /news/rss/

     

    Is this intended behaviour, or a bug with the SearchForTemplate NotFoundHandler?

    If anyone else thinks that it is a bug, then I'll raise a CodePlex ticket and offer a patch.

    Thanks, Lee.

    Update: Forgot to mention, I am using Umbraco v4.7.1.1 (but also recall this happening on v4.7.1)

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 15, 2012 @ 16:17
    Dirk De Grave
    0

    Lee,

    Just checked on a site that's running in dev mode and on v4.7.1.1 and for me it's the opposite, /news/rss won't work but /news/rss/ will (Ok, I don't use the same alternate template, but you get the point)

    So, I guess the difference is a settings umbracoSettings.config 

    <addTrailingSlash>true</addTrailingSlash>

    which in your case should be false?

     

    Anyway, since you append the alternate template yourself, I guess you're responsible for setting the trailing slash yourself when using alternate templates!

     

    Cheers,

    /Dirk

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Feb 15, 2012 @ 16:23
    Lee Kelleher
    0

    Thanks for testing this too Dirk, much appreciated.

    Weird thing is that I've got "addTrailingSlash" set to "true" also. Hmmm.

    True, I've got control of the URL structure - so can handle this okay.  (I've actually written a custom NotFoundHandler to replace the SearchForTemplate one - which works fine too)

    Thanks again!

    Cheers, Lee.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Oct 22, 2012 @ 17:19
    Jeroen Breuer
    1

    Hi Lee,

    I've got the same problem. Alt templates only work if they don't have a trailing slash at the end. So /news/rss (where rss is the alt template) works, but /news/rss/ doesn't. In some situations we show an alt template as a real page on the website and this looks strange because all the url's end with a trailing slash, but the alt template pages don't because it doesn't work. I also have addTrailingSlash set to true in the umbracoSettings.config.

    Looks like there also is an issue for it: http://issues.umbraco.org/issue/U4-543.

    Jeroen

  • Stephen 767 posts 2273 karma points c-trib
    Oct 23, 2012 @ 08:56
    Stephen
    0

    The whole things has been rewritten in 4.10, I'll make sure that /news/rss and /news/rss/ and /news/rss.aspx do work. But U4-543 seem to imply it's been fixed already. Will have a look.

  • Stephen 767 posts 2273 karma points c-trib
    Oct 23, 2012 @ 13:50
    Stephen
    0

    Tested, and it works.

Please Sign in or register to post replies

Write your reply to:

Draft