Support » Fixing WordPress » Help Please – Cannot Login to admin after moving WP to root

Viewing 8 replies - 1 through 8 (of 8 total)
  • Assuming you put all the files of your WordPress site in the root of, try putting this in your wp-config.php file:


    See if that makes your site working. If it does, you can remove the lines again.

    Hi Senff,

    First of all, thanks for your support.
    i tried your php addition but it didn’t solve the loop problem. I can reach the login page from and put the correct user/pass but it keeps sending me to the same login page again and again…

    One question:
    When moving the files from my subdirectory /wp to my root i also copied the .htaccess file. Does this interfere somehow?

    thanks again

    Well to sum things up:

    – had wordpress installed in /wp
    – backed up files+db ok
    – changed URI, URL and saved ok
    – moved files to root folder ok
    – copied .htaccess from /wp and pasted to my root ok

    problem starts when accessing
    which redirects me to:

    where i put the correct admin user/pass but it keeps resending me to the page

    so i understand that there is a loop between wp-login.php with a redirection script that i really don’t know how it came there…

    any ideas on how to fix this?

    What if you add these lines to your wp-config.php, does that make any difference maybe?

    define( 'WP_HOME', '' );
    define( 'WP_SITEURL', '' );

    ok senff you are being helpful mate…

    i changed these 2 lines in wp-cong=fig.php and it worked
    now when i put >>
    it redirects me to >> (without www)
    i can enter admin dashboard with user/pass = ok

    in the admin > settings > general i can see under URL, URI the 2 fields (with the root url without www) but i can’t edit them anymore…
    do i have to erase the two lines form the wp-config.php now that i got it working?

    hallo senff,

    as i mentioned before your trick on wp-config.php worked and i managed to get out of this redirection loop.

    Now, i have access to my admin dashboard, but i cannot change the URI, URL in general settings (probably due to the php lines i put).

    Moreover, some of the plugins that worked before are now faulty especially one slider plugin and wpml multilingual plugin.
    I tried several times to re-install these without success, and i feel a little frustrated…

    I was thinking about going back to my draft website (/wp) to see if things are working like before and then re-try to move to root..
    if i decide to do this i believe i will have to delete the two php lines from wp-config.php
    what do you suggest?

    thanks again

    Indeed, using these lines will disable the option to change them:

    define( 'WP_HOME', '' );
    define( 'WP_SITEURL', '' );

    That’s why these lines should be better:


    This should have the same effect (except that with update_option, you can remove these lines again once you get things working).

    Can you try this again and replace the define lines with the update_option lines?

    Ok senff

    indeed update_option was the trick to use
    and then erase it because it interfered with plugin functionality
    still i don’t get how i got into this loop…
    but anyway problem solved
    website back in functionality

    thanks for your time

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Help Please – Cannot Login to admin after moving WP to root’ is closed to new replies.