WordPress.org

Forums

Help Please - Cannot Login to admin after moving WP to root (9 posts)

  1. mhtcka
    Member
    Posted 1 year ago #

    Hello all

    Firstly i entered my admin normally and changed the URI, URL fields to point to the root of my site http://www.epothitaki.gr/

    Then i moved my wp site from the /wp folder to the root using ftp.

    Then i tried to login but it seems i' ve fallen to a redirection loop.

    I tried everything from the login trouble codex (entering database, changing admin passwords, renaming plugins or theme, editing wp-login.php) without success
    Please give me a hand!

    Thanks
    Dimitris

  2. Mark Senff
    Member
    Posted 1 year ago #

    Assuming you put all the files of your WordPress site in the root of http://www.epothitaki.gr, try putting this in your wp-config.php file:

    update_option('siteurl','http://www.epothitaki.gr');
    update_option('home','http://www.epothitaki.gr');

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

  3. mhtcka
    Member
    Posted 1 year ago #

    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 http://www.epothitaki.gr/wp-admin 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
    D.

  4. mhtcka
    Member
    Posted 1 year ago #

    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 http://www.epothitaki.gr/wp-admin/
    which redirects me to:
    http://epothitaki.gr/wp-login.php?redirect_to=http%253A%252F%252Fepothitaki.gr%252Fwp-admin%252F&reauth=1

    where i put the correct admin user/pass but it keeps resending me to the page http://epothitaki.gr/wp-login.php

    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?

  5. Mark Senff
    Member
    Posted 1 year ago #

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

    define( 'WP_HOME', 'http://epothitaki.gr' );
    define( 'WP_SITEURL', 'http://epothitaki.gr' );
  6. mhtcka
    Member
    Posted 1 year ago #

    ok senff you are being helpful mate...

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

    however:
    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?

  7. mhtcka
    Member
    Posted 1 year ago #

    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
    Dimitris

  8. Mark Senff
    Member
    Posted 1 year ago #

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

    define( 'WP_HOME', 'http://epothitaki.gr' );
    define( 'WP_SITEURL', 'http://epothitaki.gr' );

    That's why these lines should be better:

    update_option('siteurl','http://epothitaki.gr');
    update_option('home','http://epothitaki.gr');

    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?

  9. mhtcka
    Member
    Posted 1 year ago #

    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
    Dimitris
    Athens

Topic Closed

This topic has been closed to new replies.

About this Topic