The MU forums have moved to

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

  1. samchng
    Posted 18 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.

    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
    Posted 18 years ago #


  3. samchng
    Posted 18 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
    Posted 18 years ago #

    I realised that I am able to login from the front page with any login because of a script I added from

    <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;
    // -->

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

    If I manually type in
    Login with username: test will work.

    So you cannot direct your user from main page to They will not be able to log in.

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

  5. dbasulto
    Posted 18 years ago #

    thanks on this one...

  6. samchng
    Posted 18 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
    Posted 17 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
    Posted 17 years ago #

    same here. problem still exists on mu 1.0

  9. lunabyte
    Posted 17 years ago #

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


    This is on a domain, using subdomains for registration.

  10. lunabyte
    Posted 17 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
    Posted 17 years ago #

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

    i'm having the same login problems

  12. tjnuckolls
    Posted 17 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, where there will be a login form. Once they type their username and password, they're redirected to 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.

    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.


  13. journeyguy
    Posted 17 years ago #

    Where does one add this script as mentioned above?

  14. alantv
    Posted 15 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
    Posted 15 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"
    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 18 years ago by samchng
  • Latest reply from maxbirkoff