The MU forums have moved to WordPress.org

Login redirection on wp-login.php (15 posts)

  1. samchng
    Member
    Posted 16 years ago #

    When I enter my user details in wp-login.php. In this case test is the username. I do not get redirected to wp-admin, instead I go to this url.
    http://test.domain.com/wpmu/wp-login.php?redirect_to=%2Fwpmu%2Fwp-admin%2F

    It doesn't work on any user I enter, except the admin. But user login works on home.php where I have created a login form. But admin doesn't. Cause they state that there is no such blog in database.

    Very complicated... Any ideas? Really frustrating. Been trying to debug this.

  2. samchng
    Member
    Posted 16 years ago #

    Anyone?

  3. samchng
    Member
    Posted 16 years ago #

    Nobody can help?

    Just to add, when I go to that weird URL, I can then login to dashboard without any problems.

  4. samchng
    Member
    Posted 16 years ago #

    I realised that I am able to login from the front page with any login because of a script I added from
    http://mu.wordpress.org/forums/topic.php?id=579&page=2

    <script type="text/javascript" language="JavaScript">
    <!--
    function ActionURL(formCheck)
    {
    var blog = document.loginform.log.value;
    var server = 'DOMAIN';
    if (formCheck.log.value =="admin") document.loginform.action = ('http://' + server+ '/wp-login.php');
    else document.loginform.action = ('http://' + blog + '.' + server+ '/wp-login.php');
    return true;
    }
    // -->
    </script>

    This directs the server to the proper wp-login.php.

    If I manually type in test.domain.com/wp-login.php
    Login with username: test will work.

    So you cannot direct your user from main page to
    domain.com/wp-login.php. They will not be able to log in.

    Will work to improve the wp-login.php to redirect to
    username.domain.com/wp-login.php, that would then work for all.

  5. dbasulto
    Member
    Posted 16 years ago #

    thanks on this one...

  6. samchng
    Member
    Posted 16 years ago #

    Glad it helped you dbasulto. ;)

    I managed to get around this. Just add the script to wp-login.php and it works like a charm! So no matter where your user logs in from, they will get redirected to the right place. Self-support over. Cheers! :)

  7. Ovidiu
    Member
    Posted 15 years ago #

    can someone explain in a few words what this is supposed to fix and if it is still needed with wpmu 1.0 ?

    btw. could we have the login form somehow redirect the user after login to the frontend, not the backend? I use the mu-admin bar so its ok for users to get redirected to the frontend instead of the backend...

  8. OsmanSBrtecene
    Member
    Posted 15 years ago #

    same here. problem still exists on mu 1.0

  9. lunabyte
    Member
    Posted 15 years ago #

    I can confirm this.
    Logging in with user other than admin redirects back to:

    wp-login.php?redirect_to=%2Fwp-admin%2F

    This is on a domain, using subdomains for registration.

  10. lunabyte
    Member
    Posted 15 years ago #

    As a note, it was a cookie issue on mine, that was self-generated (oops!).
    Typo's... don't they suck?

    Same symptoms though. The cookie was being set for the wrong domain, so trying to get into the admin section made it keep coming back to the login page.

    Oh well.

  11. homeowner
    Member
    Posted 15 years ago #

    samchng, would this script only work for test.domain.com? What if the blog was installed using the other option - each user has their own directory - e.g.: domain.com/blog/test

    i'm having the same login problems

  12. tjnuckolls
    Member
    Posted 15 years ago #

    I believe I'm in the same boat as homeowner, so I thought I'd give this a bump.

    What I need to do, to be clear (hopefully), is provide a way for my clients to go to mydomain.com, where there will be a login form. Once they type their username and password, they're redirected to mydomain.com/clientname where they can view the blog contents specific to them. They should also be unable to see any other blog even by getting lucky and typing in another clients url (i.e. mydomain.com/anotherclient).

    I just installed Angsuman’s Authenticated WordPress Plugin, ac_authenticator.php, and it seems to handle the privacy stuff okay, but no the redirect.

    I'm new typically a user of TextPattern and am new to WordPress, so your assistance is invaluable and much appreciated.

    -TJ

  13. journeyguy
    Member
    Posted 15 years ago #

    Where does one add this script as mentioned above?

  14. alantv
    Member
    Posted 13 years ago #

    Is this still valid?
    I couldn't get it to work..
    My page still redirects to the same page over and over again..

  15. maxbirkoff
    Member
    Posted 13 years ago #

    i fixed this problem by noting that i had the following line in php.ini:

    variables_order = "GPS"

    when in fact the line ought to have read

    variables_order = "GPCS"
    or
    variables_order = "EGPCS"

    this is apparently because the php-style in which wordpress-mu is written depends on variables being propagated through the environment and/or cookies.

    once i changed this setting the login loop
    ended and i was able to see a different page after logging in.

About this Topic

  • Started 16 years ago by samchng
  • Latest reply from maxbirkoff