WordPress.org

Ready to get started?Download WordPress

Forums

Network Privacy
Incorrect redirection after login using Mutlisite (4 posts)

  1. nickdenardis
    Member
    Posted 2 years ago #

    When using Multisite and requiring authentication the forward after login double's up the folder of the blog.

    EX:
    http://blogs.domain.com/marketing/ -> /marketing/wp-login.php?redirect_to=/marketing/

    Results in: http://blogs.domain.com/marketing/marketing/

    Fix:
    Line 183: header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_settings('siteurl') . $_SERVER['REQUEST_URI']));

    Add the full URL to the previous page to the redirect_to.

    http://wordpress.org/extend/plugins/network-privacy/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I'll have a look at that. That might be related to a change in WP 3.3.

    However, you may want to check and see if you have something else interfering with your redirect URL. The change that you proposed above will only work in a subdomain install. Example in a subdirectory install

    http://domain.com/subsite/ <-- sub site

    the concatenation you have done looks like this

    get_settings('siteurl') . $_SERVER['REQUEST_URI']

    http://domain.com/subsite/ . /subsite/

  3. nickdenardis
    Member
    Posted 2 years ago #

    Ah ha. Good call, I see what you mean.

    I will see if there is anything else interfering with my redirect URL but I don't think so.

    I am thinking because redirect_to doesn't start with "http" it is just appending the string to the end of the existing URL. And since there is a local wp-login.php in /marketing/ it is going to have to do some comparisons to make sure there isn't a double directory in either case.

    Just a thought.

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I am thinking because redirect_to doesn't start with "http" it is just appending the string to the end of the existing URL

    That's not how it works. You can use relative URLs (ones without http://domain.com) throughout your site.

    If the relative URL begins with a / then it starts at the root of the website. If it does not start with a / then it is relative to the current path.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic