Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » Public site redirects to login screen

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: 1071 Views
  • Junglefish
    Avatar
    Community Member
    104 Posts

    Public site redirects to login screen Link to this post

    Odd one this.

    In my dev installation, the homepage of the public site is being re-directed to the CMS login screen. It has only recently started doing this after months of no problems.

    It doesn't do this in my production installation, and the codebases are the same.

    I've checked the Access tabs of the main 'site' node and the homepage beneath it. The 'site' node says "Anyone can view pages on this site", and the homepage inherits its permissions from its parent.

    Other pages on the site can be accessed without problem, it's just the homepage that has issues.

    I've re-built, flushed, cleared caches and pretty much kicked the PC, but can't stop it re-directing.

    Of course, if I log-in to the CMS, it allows me to see the homepage.

    Anyone got any ideas?

    jf/

  • Junglefish
    Avatar
    Community Member
    104 Posts

    Re: Public site redirects to login screen Link to this post

    ^^bump^^

    Anybody able to help here?

  • Mo
    Avatar
    Community Member
    505 Posts

    Re: Public site redirects to login screen Link to this post

    What version of SS are you running?

    You don't happen to have something like:

    if(!Member::currentUser()) {
    //Some redirect code here
    }

    In the init() method on your Page_Controller class do you?

    Mo

  • Junglefish
    Avatar
    Community Member
    104 Posts

    Re: Public site redirects to login screen Link to this post

    <totally embarrassed>
    Nope, I finally figured it. The page that wouldn't show was embargoed...
    </totally embarrassed>

    Rock, lift, crawl under...

    jf/

  • Mo
    Avatar
    Community Member
    505 Posts

    Re: Public site redirects to login screen Link to this post

    Ha ha, nice!

    We all do things like that. The amount of hours I have wasted trying to chase down things that were glaringly obvious in the end .

    Mo

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