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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

URL of older page versions


Go to End


2 Posts   1319 Views

Avatar
rainerh

Community Member, 23 Posts

7 April 2012 at 4:53am

Hello everybody,

I just found out, that if I change the URLSegment of a Page or even change the hierarchy SilverStripe has some mechanism to map the old URL(s) to the new URL(s). As this is a feature I've never heard of I just wanted to ask how reliable that one is respectively where to get more info about it.

The reason why I'm asking is that I am in the process of restructuring our complete website. With approximately 2000 URL changes, correct redirection is a big issue. If SilverStripe can handle this that's fine with me. Otherwise I would have to develop such a feature by myself.

Greetings,
Rainer

Avatar
inCharge

Community Member, 102 Posts

11 April 2012 at 11:06pm

Yes, it's reliable.

If the URL doesn't exist, the version system is used to check whether a page with that URL used to exist but was renamed. If there are more than one with the same URL, the most recent is used.

The code that does this is in ModelAsController::getNestedController

I'm not sure if it works with nested URLs, but it'd only take you 5 minutes to check.