I'm currently working on an Umbraco project where I (for SEO reasons)
need to have custom URLs for each page.
The customer must have the oppertunity to create 100% custom URLs.
Ex. 1:
"/accommodations/flats/london" could be changed to
"/flats-in-london"
Ex. 2:
"/page/subpage/textpage/" could be changed to
"/shop/page"
I've tried my luck with Umbraco's "umbracoUrlName", but this
is useless since it only changes the page name and not the path to the page
aswell. I've also tried "umbracoUrlAlias", but this just gives the
page an extra alias, which is bad for dublicate content. (I could use
canonical, but this isn't a good solution)
Anyone on Our who's got experience with this?
Could I use MVC / Global.asax routes (MapRoute) to loop through all the
pages and then add a MapRoute to all the nodes who has a "customUrl"
alias? If this is possible, how is it done?
With the UrlSegment you can only change a segment of the url. So /page/text2/ could become /page/text2-2014/ but you can't do /page/text2/2014 because than it's another segment. You need a UrlProvider and ContentFinder for that. I have an example in the Hybrid Framework:
Using Global.asax to create custom URLs
I'm currently working on an Umbraco project where I (for SEO reasons) need to have custom URLs for each page.
The customer must have the oppertunity to create 100% custom URLs.
Ex. 1:
"/accommodations/flats/london" could be changed to "/flats-in-london"
Ex. 2:
"/page/subpage/textpage/" could be changed to "/shop/page"
I've tried my luck with Umbraco's "umbracoUrlName", but this is useless since it only changes the page name and not the path to the page aswell. I've also tried "umbracoUrlAlias", but this just gives the page an extra alias, which is bad for dublicate content. (I could use canonical, but this isn't a good solution)
Anyone on Our who's got experience with this?
Could I use MVC / Global.asax routes (MapRoute) to loop through all the pages and then add a MapRoute to all the nodes who has a "customUrl" alias? If this is possible, how is it done?
Maybe you can create a custom UrlSegment Provider:
http://our.umbraco.org/documentation/Reference/Request-Pipeline/outbound-pipeline
Dave
With the UrlSegment you can only change a segment of the url. So /page/text2/ could become /page/text2-2014/ but you can't do /page/text2/2014 because than it's another segment. You need a UrlProvider and ContentFinder for that. I have an example in the Hybrid Framework:
UrlProvider: https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Extensions/UrlProvider/NewsUrlProvider.cs
ContentFinder: https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Extensions/ContentFinder/NewsContentFinder.cs
Jeroen
is working on a reply...