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

redirecting entire site while building it... except if logged in


Go to End


2 Posts   672 Views

Avatar
JonShutt

Community Member, 244 Posts

23 November 2011 at 10:33am

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?

Avatar
danzzz

Community Member, 175 Posts

23 November 2011 at 12:07pm

Edited: 23/11/2011 12:08pm

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