Jump to:

23575 Posts in 19403 Topics by 2893 members

General Questions

SilverStripe Forums » General Questions » Creating a automatic redirector to the parent page

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

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

Page: 1
Go to End
Author Topic: 438 Views
  • theGermaniac
    Community Member
    82 Posts

    Creating a automatic redirector to the parent page Link to this post

    Hej there.

    I wrote a redirector page to the parent page inside SiteTree. Works perfectly, but when "Split Mode" is enabled, and I call the page via SiteTree, the CMS jumps to the parent page.

    Here ist my code:

    class ParentRedirect_Controller extends ContentController
       public function init()
          if($link = $this->Parent()->Link())
             $this->redirect($link, 301);

    This issue is not, when using the standard redirector page type. Can anyone tell me, how to avoid this jump to the parent page inside the CMS? Thanks.


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.