• Resolved feerko

    (@feerko)


    Hello, i wanna to allow entry to all sites without /test/ and /test2/, there is way to do this using your plugin?

    Thanks

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

    (@feerko)

    I mean to entry /test/ and /test2/ you need to log in.

    Plugin Author Kevin Vess

    (@kevinvess)

    Is this for a multisite install or are those just two pages?

    Thread Starter feerko

    (@feerko)

    just two pages.

    Plugin Author Kevin Vess

    (@kevinvess)

    Then I recommend you just use the builtin functionality to mark those pages as “Private.”

    https://codex.ww.wp.xz.cn/Content_Visibility

    Force Login does the opposite of what you want – it blocks public access to the entire site with options to whitelist (allow) certain pages.

    Thanks for your interest in Force Login!

    Thread Starter feerko

    (@feerko)

    Thanks for quickly reply. I would like to see the page you need to be logged in. I do not want to create a password for the page.

    I mean something like that

    if (url == ‘test’ || url == ‘test2’)
    {
    bypass = false;
    }
    else
    {
    bypass = true;
    }

    there is way do to this using your plugin?

    Plugin Author Kevin Vess

    (@kevinvess)

    Yes– you could do what you’re suggesting, but I wouldn’t in this case.

    By doing it that way– you’re adding extra steps by requiring all pages to be logged into with Force Login, then using the bypass filter to undo the functionality for every page except for these two pages.

    Public > Private > ( if not /test/ ) Public again

    Seems like extra processing just to make two pages private. Instead you should just write your own logic to check for these two pages and then redirect visitors to the login screen.

    Public > ( if /test/ ) Private

    Or– mark them as “Private” pages and if you want to be able to “see the page” in your navigation, you could just filter your nav menu to include “private” pages. Then, you could just write a script that redirects any private pages to the login screen.

    Also– Force Login blocks public access to the REST API as well – which may cause you further issues if you want/need that to be publicly accessible.

    Thread Starter feerko

    (@feerko)

    After install this plugin I get ‘Error #404’ instead of login screen, it’s not what i need.

    Plugin Author Kevin Vess

    (@kevinvess)

    Can you expand on this issue?

    When do you get the 404 error?

    I assume you’re able to access your /wp-login.php page to log in? And you only get the 404 error when a non-logged-in visitor tries to view a page on your site?

    Thread Starter feerko

    (@feerko)

    when I use “Content Visibility” and get 404 while I click on a private page instead of the login page. After login it works normal.

    I wanna login page and redirect to this private page after login.

    Plugin Author Kevin Vess

    (@kevinvess)

    Yes– that is how the WordPress “Content Visibility” feature works by default. If you’re not logged-in, then WordPress considers “Private” pages as non-existent and thus shows the visitor the 404 error page.

    This issue is unrelated to the Force Login plugin and beyond the scope of my assistance.

    If you want to go with the “Private” page route– you’ll need to write some custom code to redirect visitors to the login screen for those page types; and filter your navigation menu(s) to include “Private” page links.

    I recommend you hire a developer to help you customize your site in this way. Unfortunately, Force Login was not designed for your use-case.

    Thanks for your interest in Force Login, and good luck!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Blacklist’ is closed to new replies.