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)
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!
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)
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.
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.
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:
This URL does not work:
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)
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
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
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.
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
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.
Tested, and it works.
is working on a reply...