Redirector page multiple url segments

Silverstripe Version: 4.5

Trying to use a redirector page to redirect a url like /some-parent/some-child-page but is always rewritten to some-parentsome-child.

Under the URL Segment field is says “Special characters are automatically converted or removed.”

So obviously it treats the slash as a special character. It’s not that special for a url… especially one you want to rewrite.

Is there any way to stop that behaviour and leave the slash alone or this is an expected limitation and to redirect multi segments we need to do at DNS/server level?

If you’re putting the redirector at the root of the SiteTree, then it’s expected, yes. The SiteTree is a visual representation of the page hierarchy which is also reflected in the URLs.

You’d need a page with the URL /some-parent and then add the redirector as a child of that with the URL some-child-page and it ought to work.

Failing that, if you want to avoid having these things in the sitetree, you might be better off adding an htaccess rule or using the redirects module