21309 Posts in 5738 Topics by 2603 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, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 170 Views |
-
redirecting entire site while building it... except if logged in

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?
-
Re: redirecting entire site while building it... except if logged in

23 November 2011 at 12:07pm Last edited: 23 November 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 ...
| 170 Views | ||
|
Page:
1
|
Go to Top |


