There is a convention in Umbraco that a url matches the structure of the pages in the content tree, a request will load the matching page with it's published template.
There is a hidden feature though, of being able to request a page to be loaded with a different template than it is published with... and this is by adding ?altTemplate=aliasofothertemplatehere to the url...
eg
/home/page/?altTemplate=anotherTemplate
now nobody likes querystrings like this, so the convention over the years became
/home/page/anotherTemplate.aspx
but nobody uses aspx extensions any more so this became
/home/page/anotherTemplate
your page would be loaded with the 'anotherTemplate'
so my guess is you have called your template page2
and this is why
/home/page1/page2 is returning content
it's returning page1's content but with the 'page2' template!
You can turn this convention off in /config/umbracosettings.config
in the web.routing element: set disableAlterativeTemplates to true
umbraco routing
Hi
I have 2 Umbraco pages (each with a different Template and Document Type) Expl.
Home
--> Page1
--> Page2
Why does the routing allows me to view Page2 under Page1? url like: https://Home/Page1/Page2
how do i prevent this routing?
Regards Leroux
Hi Barlo
There is a convention in Umbraco that a url matches the structure of the pages in the content tree, a request will load the matching page with it's published template.
There is a hidden feature though, of being able to request a page to be loaded with a different template than it is published with... and this is by adding ?altTemplate=aliasofothertemplatehere to the url...
eg
/home/page/?altTemplate=anotherTemplate
now nobody likes querystrings like this, so the convention over the years became
/home/page/anotherTemplate.aspx
but nobody uses aspx extensions any more so this became
/home/page/anotherTemplate
your page would be loaded with the 'anotherTemplate'
so my guess is you have called your template page2
and this is why
/home/page1/page2 is returning content
it's returning page1's content but with the 'page2' template!
You can turn this convention off in /config/umbracosettings.config
in the web.routing element: set disableAlterativeTemplates to true
regards
Marc
Great info, thanks!
Thanks Marc
Worked great, but I don't get a 404 page when requesting /home/page1/page2.
It resolves to Page1
Any other page (expl. /home/page/page3) returns a 404.
Any Ideas?
is working on a reply...