Information - Subfolder1 - - Page1 - - Page2 - Subfolder2 - - Page3 etc.
I want the viewer only to see the url /information/page but is it possible to redirect to the correct page while excluding the subfolder in the url? Like this: /information/Page3 redirects to /information/subfolder2/page3 and /information/Page2 redirects to /information/subfolder1/page2
I guess I could hard code the redirects but is there a way to do this dynamic?
You'd then have to take the URL and grab the page name eg Page1, then implement an xpath lookup on the full umbraco nodeFactory to find the instance where the unique page name matches... You can change the Xpath to be as specific or global as you want depending on your strucutre.
UrlRewriting to unknown folder
Hello
I have a structure like this:
Information
- Subfolder1
- - Page1
- - Page2
- Subfolder2
- - Page3
etc.
I want the viewer only to see the url /information/page but is it possible to redirect to the correct page while excluding the subfolder in the url?
Like this:
/information/Page3 redirects to /information/subfolder2/page3
and
/information/Page2 redirects to /information/subfolder1/page2
I guess I could hard code the redirects but is there a way to do this dynamic?
If Page1, Page2, Page3 are intended to be unique... then you could write something based on the 404 redirect wiki... [http://our.umbraco.org/wiki/how-tos/how-to-implement-your-own-404-handler] (changing the status code/header so it's not a 404 but the mechanism you require.)
You'd then have to take the URL and grab the page name eg Page1, then implement an xpath lookup on the full umbraco nodeFactory to find the instance where the unique page name matches... You can change the Xpath to be as specific or global as you want depending on your strucutre.
Once you have your node it's a simple thing to redirect or rewrite the incoming page to the actual umbraco path using NiceUrl.
is working on a reply...