• (I think this is not possible in the current version of WordPress, but I wanted to check before entering this as a feature request.)

    Most of the pages on our site are visible to logged-in-users only. Our site is pretty massive, multi-site, so users will send each other deep links in e.g. email, and users like to bookmark deep links. (So https://site.com/blogname/some/specific/post or https://site.com/blogname/somepage .) However, on login, users are redirected to blogname/wp-admin, not the page they originally requested. I’ve found ways to redirect them to some other generic page, but no way to redirect them to their originally requested page.

    I have a function hooked to wp_authenticate. I used this function to explore the values set in or returned by the following when wp_authenticate is first called for a non-logged-in-user requesting a deep link:
    wp_get_original_referer();
    wp_get_referer();
    $_GET[‘redirect_to’];
    $_SERVER[‘HTTP_REFERER’];
    $_REQUEST[‘redirect_to’];
    $_SERVER[‘PHP_SELF’];
    $_SERVER[‘REQUEST_URI’];
    Mostly, everything is blank (especially for a bookmark or link from email – the referers have nothing), and php_self, request_uri are just blogname/wp-login.php or wp-login.php.

    So, it looks to me like the rewrite script discards the original deep link request data, and there’s no way, once the user is passed to wp_authenticate, to determine the URL they originally requested. But is this true? Has anyone successfully addressed this issue before?

    (A plugin like viper’s from where you came isn’t useful in this case because the users haven’t clicked a login link.)

Viewing 1 replies (of 1 total)
  • Thread Starter nadaoneal

    (@nadaoneal)

    I’ve added this as a feature request here, since the lack of response implies to me that it is indeed a missing feature.

Viewing 1 replies (of 1 total)
  • The topic ‘redirect to original url request after login – possible?’ is closed to new replies.