Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Modifying the routes for SiteTree


Go to End


3 Posts   1148 Views

Avatar
Talbet

Community Member, 7 Posts

8 December 2015 at 8:48pm

Wondering if anyone had run into anything like this before:

I have subpages in the site tree that a nested under an "about" page something like this

| -- About
    | -- About Us
    | -- Contact Us

This works great for menus, but is there a way to set an absolute url and change this mysite.com/about/about-us to something like mysite.com/about-us?

We have an external SEO consultant who is asking for specific urls for these pages, and I can't think of a way to do this without flattening the site tree and losing the helpful structure and parent/child methods.

Avatar
Devlin

Community Member, 344 Posts

9 December 2015 at 5:04am

You could use "SiteTree::disable_nested_urls();" to disable nested urls. Or you could set up VirtualPages for each nested page you want to put forward.

Though I would say that nested urls are inconsequential.

Avatar
Talbet

Community Member, 7 Posts

9 December 2015 at 12:24pm

Thanks Devlin for the tip, wasn't aware of "SiteTree::disable_nested_urls();" but it looks like that will do the trick. Agree that it's probably inconsequential, but have to get it done so I'm glad there is a simple solution.

Cheers