• Resolved nirgalo

    (@nirgalo)


    Hi, I am making a fully private site, I want all the content to be protected. To that attention, I went into the restriction settings and set “/” as the base URL for protection. So when a user comes in (not logged in), she lands on the membership option page, which is not what I want. I want users to come by default to the Login page (when they are not logged in, else the home page). How can I do that? Thanks.

    https://wordpress.org/plugins/s2member/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter nirgalo

    (@nirgalo)

    Also, the membership option page doesn’t hide the top level menu of my site. I need it to be hidden until the user has logged in.

    Thread Starter nirgalo

    (@nirgalo)

    FYI I managed to workaround the problem by making a custom login page (based on the actual membership login page) by patching header.php/page.php.footer.php of my child theme. I do a check to the page id corresponding to the membership option page (which is empty) and if so I put in the code of the login page, else the regular code. This is working but is a bit of a pain.

    You are fighting the plugin instead of working with it. Try removing “/” as the base URL for protection, and instead protect via categories, posts, and pages.

    Then set as the site’s home page the first page you want your logged-in members to see. Then set the Welcome page in s2member as the very same page, but using the re-direct option. (This will avoid causing an internal conflict).

    Now logged-out visitors should be sent to the login page, and logged-in visitors will be sent to the intended Welcome page.

    Thread Starter nirgalo

    (@nirgalo)

    Thanks KTS915 for the quick reply. I do not fully understand how to apply your recommendations in my context:
    – the home page of the site is not a static page, it is the “latest post” default page (whose display in customized by the theme). So when you are saying “set as the site’s home page the first page you want your logged-in members to see”, I have no idea how to do this, as my home page is not a static page, but it is “/” (root or the site)
    – “Then set the Welcome page in s2member as the very same page, but using the re-direct option” -> do you mean I should redirect to “/” ?

    Thanks for your help.

    Under the Login Welcome Page setting in the s2member back-end, you will see a box headed “Or, A Special Redirection URL?” Follow the instructions there, and type in the full URL, starting with: http://

    If you insist on using only “/” you will just get frustrated.

    Thread Starter nirgalo

    (@nirgalo)

    ok so here is what I did:
    – I removed “/” from the “URL restriction” settings as well as any s2member customization in my header.php/page.php/footer.php
    – I set post/page/tag/categories access restrictions to ‘all’ (only in line “level #0 or higher”)
    – in the Welcome Page settings, redirection, I tried various things:
    http://members.mysite.com (this is the home page)
    http://members.mysite.com/s2member-login-welcome-page/ (a page that used to be the welcome page when no redirection was involved)

    result : a non logged-in user sees the homepage…

    Have you got a caching plugin running? If so, try clearing the cache and re-saving permalinks.

    Thread Starter nirgalo

    (@nirgalo)

    I have no cache plugging. I went to WordPress settings to save again the permalink settings. I cleared the browser cache and restarted it, but same thing.

    In fact I don’t see how what you are mentioning could work, because in my case I need to protect the whole site, not a single page must be accessible from the outside without being logged in. So functionally this is very simple: if user opens http://members.mysite.com, the login page must show up (unless credentials saved through cookies, then the homepage should open), else the home page should open (the home page not being a static page but the actual http://members.mysite.com/).

    Then you will need to create a specific login page, and set that as the home page.

    Did you find a way to do this? I’m looking to do the same thing.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Protect whole site and single login page’ is closed to new replies.