For a travelwebsite, i have a contenttree like this: /Countries/MyCountryName/Cities/MyCityName/ (and some other subcontent) /Countries/MyCountryName/Trips/MyTripTitle/ (and some other subcontent)
The Nodes Cities and Trips can contain many subnodes in larger countries. The URL for these pages are (Root not included): /MyCountryName/Cities/MyCityName /MyCountryName/Trips/MyTripTitle
What i really want is to remove the word "Cities" and to remove the word "Trips" from the URL. I need it in the content to keep it clean and clear, but i don't want it in the URL.
Is there a way to create the url automatically to these without changing the contenttree? /MyCountryName/MyCityName /MyCountryName/MyTripName There will never be double URL's because a tripname is never a cityname, and if it is, than so be it (someone should change the tripname in that case)
I read a similar post yesterday and did some tests with it, but there are 2 issues for me if i use this: - Needs to be done automatically (dummy user proof) (but maybe i can autogenerate this value) - It creates duplicate content. It should give a 301 response if someone gets access to the old/invalid url
If there's no other solution, i'll give this a try. But then i need to extend the url rewriter to answer with a 301 on the original URL.
If you are on version 6.1 or above, you should look into a "ContentFinder" which sounds like it might do what you want. The challenge you might have is without knowing whether the Url segment (e.g., MyCityName or MyTripName) lives inside the "Cities" or "Trips" node, you probably won't be able to easily use Url Rewriting to send you along to the correct place, and would need to programatically search for the desired node by recursing both branches. (You would also want to make sure you never have both a City and a Trip that have the same node name, or else one would be unreachable.)
If you're not on 6.1 or a ContentFinder doesn't work for you, I suppose you could have UrlRewriter convert the path parts and send you to an underlying page such as /getPageByCityOrTripName.aspx?country=myCountryName&slug=MyCityName, which would be a programmatic page that does the node querying mentioned above and can then either display the correct page from there, or else could return a 404. With the UrlRewriting, your URL would remain nice and clean and people wouldn't have to see this ugliness behind the scenes.
Remove Folder or DocumentType from URL path
Hi,
For a travelwebsite, i have a contenttree like this:
/Countries/MyCountryName/Cities/MyCityName/ (and some other subcontent)
/Countries/MyCountryName/Trips/MyTripTitle/ (and some other subcontent)
The Nodes Cities and Trips can contain many subnodes in larger countries.
The URL for these pages are (Root not included):
/MyCountryName/Cities/MyCityName
/MyCountryName/Trips/MyTripTitle
What i really want is to remove the word "Cities" and to remove the word "Trips" from the URL.
I need it in the content to keep it clean and clear, but i don't want it in the URL.
Is there a way to create the url automatically to these without changing the contenttree?
/MyCountryName/MyCityName
/MyCountryName/MyTripName
There will never be double URL's because a tripname is never a cityname, and if it is, than so be it (someone should change the tripname in that case)
Many Thanks
Here's a post from a few years ago... but as far as I know should still work using the "umbracoUrlAlias" property.
Thanks Andy,
I read a similar post yesterday and did some tests with it, but there are 2 issues for me if i use this:
- Needs to be done automatically (dummy user proof) (but maybe i can autogenerate this value)
- It creates duplicate content. It should give a 301 response if someone gets access to the old/invalid url
If there's no other solution, i'll give this a try. But then i need to extend the url rewriter to answer with a 301 on the original URL.
If you are on version 6.1 or above, you should look into a "ContentFinder" which sounds like it might do what you want. The challenge you might have is without knowing whether the Url segment (e.g., MyCityName or MyTripName) lives inside the "Cities" or "Trips" node, you probably won't be able to easily use Url Rewriting to send you along to the correct place, and would need to programatically search for the desired node by recursing both branches. (You would also want to make sure you never have both a City and a Trip that have the same node name, or else one would be unreachable.)
If you're not on 6.1 or a ContentFinder doesn't work for you, I suppose you could have UrlRewriter convert the path parts and send you to an underlying page such as /getPageByCityOrTripName.aspx?country=myCountryName&slug=MyCityName, which would be a programmatic page that does the node querying mentioned above and can then either display the correct page from there, or else could return a 404. With the UrlRewriting, your URL would remain nice and clean and people wouldn't have to see this ugliness behind the scenes.
Best of luck to you!
Thank you Funka, it's what it thought i have to do
is working on a reply...