Jump to:

23007 Posts in 11866 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » redirecting entire site while building it... except if logged in

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: 277 Views
  • Futureweb
    Avatar
    Community Member
    232 Posts

    redirecting entire site while building it... except if logged in Link to this post

    Hello people,

    I have a situation where I'm setting up a new SS site on a URL that is currently redirecting to the companies old site.

    so what I'd like to do is something like redirect all pages to the old site - apart from /admin/.
    this would allow me, and others to log in.
    and then when logged in, they could visit the site - and not be redirected away...

    Any suggestions?

  • danzzz
    Avatar
    Community Member
    175 Posts

    Re: redirecting entire site while building it... except if logged in Link to this post

    hi

    may this helps ...

    mysite/_config.php:

    if($_SERVER['REMOTE_ADDR'] == 'MY.IP.ADDR' || $_SERVER['REMOTE_ADDR'] == 'OTHER.IP.ADDR') {
    Director::set_environment_type("dev");
    SSViewer::set_theme('realtheme');
    } else {
    SSViewer::set_theme('devtheme');
    }

    instead of loading a special theme when a public user comes you also can readirect to old page ore something ...

    277 Views
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.