• Resolved simukaszs

    (@simukaszs)


    Hello,

    When users login, redirect is working fine, and I also use redirect to different URLS according to the users role.

    However, when the user is already logged in, and clicks on “login” he is not redirected to that URL anymore and instead stays in the login page.

    Is there any way I could make redirects for logged in users as well?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author John Godley

    (@johnny5)

    Are you describing a problem you have with an existing redirect, or want to know how to perform the above redirect?

    Thread Starter simukaszs

    (@simukaszs)

    Hi John, thank you for replying.

    I need help with an existing redirect. Is it possible to redirect the user to a custom url according to his role? Not only when they are logging in, but everytime they click on that link.

    At the moment it only redirects only when logging in.

    Thanks again.

    thats actually really important to me to
    following

    Plugin Author John Godley

    (@johnny5)

    There are different matches you can use:

    https://redirection.me/support/matching-redirects/

    Thread Starter simukaszs

    (@simukaszs)

    Hello John,

    My login page url looks like this: domain.com/login

    Currently I use URL and role/capability and this allows to redirect users to their specific members area according to their role. Works great.

    However, when a user is already logged in, and comes back to my website, clicks on domain.com/login nothing happens and he doesn’t get redirected to his members area anymore.

    I hope this explained better.

    • This reply was modified 4 years, 1 month ago by simukaszs.
    Plugin Author John Godley

    (@johnny5)

    Can you show a screenshot with your settings for this redirect?

    Thread Starter simukaszs

    (@simukaszs)

    Plugin Author John Godley

    (@johnny5)

    Are those roles correct? The role is supposed to be filled in with the role used by WordPress, not the text label assigned to that role. ‘Mock Exam’ does not look like a role.

    It should be something that is used by this function:

    https://developer.www.ads-software.com/reference/functions/current_user_can/

    Thread Starter simukaszs

    (@simukaszs)

    Yes the roles are correct and used exactly as they appear in WordPress users tab attaching a pic.

    Roles

    Plugin Author John Godley

    (@johnny5)

    That’s my point. The text you see in the menu is the text label. The plugin is expecting the underlying role/capability value.

    For example the ‘Edit Posts’ capability is edit_posts.

    It does not seem likely that the underling capability value is ‘Mock Exam’.

    Thread Starter simukaszs

    (@simukaszs)

    I see your point now. I will try to work around this and see if there is any improvement.

    Just to clarify, if everything is set up correctly, the user will always be redirected if it matches the URL and ROLE CAPABILITY?

    Plugin Author John Godley

    (@johnny5)

    It should be, yes.

    Thread Starter simukaszs

    (@simukaszs)

    It works perfect! Thank you John for your help and a great plugin. Leaving a 5star review.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Redirect for logged in users’ is closed to new replies.