request: after login, redirect to originally requested url (2 posts)

  1. nadaoneal
    Posted 5 years ago #

    Feature request: If a non-logged-in user requests a deep link (like http://site.com/blogname/some/specific/post ) on a blog with privacy set to "logged-in users only" or higher, then after they log in, they should be redirected to the URL they originally requested. (Login plugins should also have access to make this redirect happen.)

    Currently, users need to be redirected to some predefined page. In wp_authenticate the original url request data is not available in e.g. HTTP_REFERER and e.g. REQUEST_URI will just have wp-login.php. (I posted about this here with more technical detail.)

    Rationale: Now that WPMU is rolled in to WP3, sites can be truly massive, with thousands of users with access to scores of different blogs, and users are bookmarking and emailing deep links. They've also become accustomed, on other sites, to being redirected to their originally requested url after login. So this would be a really nice feature to have for them.

    Thanks for your time, please let me know if I should clarify anything, or if I missed a post on a similar topic.

  2. Login plugins should also have access to make this redirect happen.

    They do. I use it all the time for in-page login (I have a login form on the front end of every page). Read http://codex.wordpress.org/Function_Reference/wp_login_url and see how it talks about the redirect parameter? :) You can populate it with the page people are on.

    If your plugin can't handle this, try http://www.theblog.ca/wplogin-redirect

Topic Closed

This topic has been closed to new replies.

About this Topic