• Just started using the 404 Redirect with groups and came across a cached issue with the redirect. If users are not logged in when they visit a protected page (www.example.com/for-members) they are correctly redirected to a page asking them to log in (www.example.com/please-log-in). They successfully log in through a custom login page and try to access the protected page (www.example.com/for-members) and the cached version of the page is loading asking them to log in.

    If I access the protected page and am not logged in then log in after the redirect but clear my history then I’m directed to the protected page as expected.

    Will the plugin return users to the protected page they were trying to access after the criteria is met or is there another solution?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi katjmars,

    I’m not sure, based on the above, what is the actual issue here. Is it that you are still requested to authenticate after login, or that you are not redirected after login?

    I would also recommend you to try the first option, the one that redirects to login, when a guest/user is not allowed to view the content being visited. This option, will take you to the WP default login page and redirect to the originally requested URL upon success. The core WP function wp_login_url() supports a redirect after a successful authentication and perhaps this is something you could use in your custom login page.

    Kind regards,

    George

    Thread Starter katjmars

    (@kmarschner)

    @gtsiokos – thanks for the feedback. The issue is the latter: Users who are not logged in attempt to visit a protected page. Because they are not logged in they are redirected to a page explaining why they can not see the protected page. From that explanation page we provide a link to our custom login page. After they log in and try to visit the protected page they are still redirected to the explanation page, presumable because browsers are loading a cached version of the page. The default WP login page is not an option for us.

    Hi katjmars,

    You’re welcome.

    FYI, the plugin applies a redirect for guests, or for authenticated users that don’t have privileges to view the specific page. Therefore, this process doesn’t relate to the browser cache.

    As long as the authentication process appears to be successful through your login page, but the current user still appears as guest, then this is the part you should check further.

    Kind regards,

    George

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cached page still redirecting’ is closed to new replies.