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.

General Questions /

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

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


Reply


2 Posts   389 Views

Avatar
Futureweb

Community Member, 233 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 ...