Auto Redirect to Login

Discussion in 'Setting-up protection' started by rickydeez, Mar 11, 2013.

  1. rickydeez

    rickydeez New Member

    Joined:
    Aug 3, 2007
    Messages:
    20
    How would I go about redirecting all traffic to the login page?

    I don't want any guests to be able to view any pages (except signup of course), but instead I need anyone who isn't already logged in to be automatically directed to the login page.

    I would think this should be a feature within aMember itself, but I wasn't able to find it.
  2. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    For your main home page simply code it to redirect to login page with something similar to this:

    PHP:
    <?php
        header
    ("Location:your-amember-directory/member/index");
    ?>
    then anybody arriving at your site would be redirected to login page.
  3. rickydeez

    rickydeez New Member

    Joined:
    Aug 3, 2007
    Messages:
    20
    That just redirects to the main Index page, not the login.

    I suppose I could redirect to "/login" instead.

    Not the best solution IMO though.
  4. rickydeez

    rickydeez New Member

    Joined:
    Aug 3, 2007
    Messages:
    20
    All the other pages are obviously protected (Profile, History, Affiliate, Help Desk), so how would I go about protecting the Index page as well?
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
  6. rickydeez

    rickydeez New Member

    Joined:
    Aug 3, 2007
    Messages:
    20
  7. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    the sites index or default page is the landing page so a simple redirect from there will pass visitors to the login page.

    ../member/index is what I use to link to login page but use /login instead no problem.

Share This Page