• Resolved fabio323ti

    (@fabio323ti)


    Redirect to requested link after login.. not work!

    for example calling link : https://www.sitename.com/account/customerpage

    I set default redirection after login to “referral url” in plugin settings..

    i’d used this code snippet

    if (!is_user_logged_in() && is_page ( [50710])) {
        $redirect = '/login/?redirect_to=' . esc_url($_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
        wp_redirect( $redirect );
    			}

    but after login always return always to homepage..

    does exsist a specific hook funcion to override plugin settings?

    thanks

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

    (@reputeinfosystems)

    Hello,

    As you have mentioned that, you have set the “Referrer Page” option for the successful login redirection page. which means the last opened page will be redirected after login. So, accordingly, if you open the direct login page then the page will be redirected to the home page because there is no “Referrer Page” (previously opened) page available.

    So, the page will be redirected as per the setting in the “Default Redirect URL” from ARmember -> General Settings -> Redirection Rules page at “After Login Redirection Rules”.

    Also, to set up referrer page redirection, you don’t need to make changes from the code file.

    Please let me know if there is anything else.

    Thanks

    Thread Starter fabio323ti

    (@fabio323ti)

    i’d follow your steps but not works.

    this is snippet i’d used to :

       if ( ! is_user_logged_in() && is_account_page() && ( is_woocommerce() || is_shop() ||
    is_cart() || is_checkout() || is_account_page() ) ) {
            wp_redirect( get_option('home') . '/login?redirect_to=' . esc_url($_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]) );
    		exit();
        }

    with this always back to home after login…

    i’d already setted up in your plugin redirect after login to referral…

    maybe i’m wrong, can you make me a example of login with redirect link?

    for example, calling /my account page > redirect to /login page and after back to account page.

    thanks

    • This reply was modified 3 years ago by fabio323ti.
    • This reply was modified 3 years ago by fabio323ti.
    Plugin Author reputeinfosystems

    (@reputeinfosystems)

    Hello,

    I understand your concern but as I have explained to you in previous reply that you don’t need to add any custom code to achieve the redirection and also you have not mentioned that at which code file you have added the custom code.

    If possible please share the website page URL from where you face such issue so I can check at your website and assist you further.

    Thanks

    Thread Starter fabio323ti

    (@fabio323ti)

    The custom code is for woocommerce page and is added to function.php, by the way, also removing the code, the url link https://sitename/login/?redirect_to=-….. is not working on your plugin.

    Thread Starter fabio323ti

    (@fabio323ti)

    with this snippet also not works.

    function wc_redirect_non_logged_to_login_access() {
        if ( ! is_user_logged_in() && ( is_woocommerce() || is_shop() || is_cart() || is_checkout() || is_account_page() ) ) {
            global $wp;
            $redirect = rawurlencode( trailingslashit( site_url() ) . $wp->request );
            wp_safe_redirect( get_option( 'home' ) . '/login?redirect_to=' . $redirect );
            exit();
        }
    }

    i need woocommerce and account under login and redirec to called page.

    Its so complicated fix armember plugin?

    Plugin Author reputeinfosystems

    (@reputeinfosystems)

    Hello,

    I understood the request and kindly note that you have to select the page from the list or provide the page URL in ‘ARMember’ -> ‘Redirection Rules’ -> ‘After Login Redirection Rules’.

    So after that page will be redirected to that page after successful login to the site.

    Thanks

    Thread Starter fabio323ti

    (@fabio323ti)

    Yes you’re tight but armember redirect settings is for whole site and whole pages….

    this is not for my scenario…

    if unlogged users browse to a url > “www.yoursite.com/restrictedpage” .. it automatically redirect to login page… but after successfull login it comes to > “Default armember redirect settings” …..

    i need > “www.yoursite.com/restrictedpage” > “login page ” > “back to “www.yoursite.com/restrictedpage” …

    when user call a pages that need login should be redirect to them and not to globaly armember settings redirection.

    its ok now? can be done?

    Plugin Author reputeinfosystems

    (@reputeinfosystems)

    Hello,

    I have checked at our local server by accessing the restricted page and redirecting to the login page and when I logged in then successful redirection redirected to the restricted page without any issue. So there is no issue found.

    Please note that, if the logged-in user has no permission to access the page then obviously page will not be accessible because the member has no permission to access the page.

    Kindly check accordingly and let me know if there is anything else.

    Thanks

    Thread Starter fabio323ti

    (@fabio323ti)

    Did you read my posts? did you understand what i mean?

    i need > “www.yoursite.com/restrictedpage” > “login page ” > “back to “www.yoursite.com/restrictedpage” …

    • This reply was modified 2 years, 11 months ago by fabio323ti.
    Plugin Author reputeinfosystems

    (@reputeinfosystems)

    Hello,

    I apologize for the delay in reply.

    Yes, I have understood your case properly and I have checked by adding a restricted page in the navigation menu and I have opened the home page of our website, and then I have clicked on the restricted page link.

    Page redirected to the login page and when I have logged in with the user then it redirected me back to the restricted page without any issue.

    If you can record a short video of your situation, it would help us to understand your situation better.

    Thanks,

    Thread Starter fabio323ti

    (@fabio323ti)

    The Problem still On, i can’t back to previous page after login… plugin always come back to “setted page in setup settings”.. no way to redirect to last page…

    very struggle about this.

    Reputesystem can you make and example or share php example to work with it as you wrote?

    my php line is : wp_redirect( get_option(‘home’) . ‘/login?redirect_to=’ . esc_url($_SERVER[“HTTP_HOST”] . $_SERVER[“REQUEST_URI”]) );

    (the url on top bar is correct, i can see correct page value.. but plugin not works as axpected)

    thanks

    • This reply was modified 2 years, 5 months ago by fabio323ti.
    bobo346457

    (@bobo346457)

    Same problem here.
    I have set
    Referrer Page (Original page before login.)

    but every time it goes to “Default redirect” ignoring the referrer

    • user open restricted page
    • redirectered to login
    • after login, it goes to ‘Default Redirect URL’

    The expected behavior is to go to the Referrer page as setup.

    Thread Starter fabio323ti

    (@fabio323ti)

    i had same issue and I solved.
    the Referral page is working only for restricted page managed by arm ember plugin.

    if you setup content restriction and try to request the restricted url.. you’ll redirect to login page and successful redirect to original url.
    Plugin is working.. only if you its restriction settings and his rules.

    hope its helps

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Redirect after login feature’ is closed to new replies.