How to change the url structure while keeping content node tree
I have this content tree structure:
- Posts - 2011 - January - My Post
The resulting url on Model.Url is: /posts/2011/january/my-post/
Is there a way to keep the content tree structure like this, but have Model.Url (or DynamicNode .Url) return a url without the "/posts/" part? ie /2011/january/my-post/
I want to be able to hit /2011/january/my-post/ in the browser and also go to that page.
I know that umbracoUrlAlias will allow me to shorten the url, however I specifically want Model.Url (a DynamicNode's .Url) to give me the shortended url structure because I want my package imediately compatible with sitemap packages.
I suspect that I should be able to do this using Umbraco's routing/virtual directory handling, but I have no idea where to start with this.
How to change the url structure while keeping content node tree
I have this content tree structure:
- Posts
- 2011
- January
- My Post
The resulting url on Model.Url is: /posts/2011/january/my-post/
Is there a way to keep the content tree structure like this, but have Model.Url (or DynamicNode .Url) return a url without the "/posts/" part? ie /2011/january/my-post/
I want to be able to hit /2011/january/my-post/ in the browser and also go to that page.
I know that umbracoUrlAlias will allow me to shorten the url, however I specifically want Model.Url (a DynamicNode's .Url) to give me the shortended url structure because I want my package imediately compatible with sitemap packages.
I suspect that I should be able to do this using Umbraco's routing/virtual directory handling, but I have no idea where to start with this.
Hi Anthony
Would it be an option to look at the UrlRewriting.config perhaps? Or am I missing something here?
/Jan
Hey Jan
That is a workaround which I considered.
The issue is that when I mouse over a link to that post, I will still see /posts/2011/january/my-post/
I can of course route /posts/2011/january/my-post/ to /2011/january/my-post/, but ideally I want to mouse over the nice shortened link.
This is more of an issue if people want to remove all the parent folders from the url and have say /my-post/ as the link. It's much prettier.
Any suggestions?
is working on a reply...