If access WordPress login page using website preview, it is redirected to the original website

Follow

Comments

8 comments

  • Avatar
    Vik

    If we cant login to wordpress's control panel, we can not access to the WordPress dashboard Settings > General section.

  • Avatar
    Ivan Postnikov (Edited )

    Hello @Vik, in this article WordPress control panel is accessible.

    Could you, please, share the details, is there any error message shown for you?

  • Avatar
    Vik

    sorry, I understood that you can not access Wordpress Dashboard when you tried to sign in.

    Example: you try to access to your preview website in this url:

    I found a easy solution adding this line into the wp-config.php file (before mysql section)

    • define('RELOCATE',true); 

    This is good for me

    Now, I can login to my preview site in plesk and login to Wordpress Dashboard

    I hope this can help others

     

     

     

  • Avatar
    Mario

    Hi, 

    Disable https in the live site is not an option: 1) obvious security reasons 2) Google ranking and 3) Google alert of unsafe website (as per July 1st 2018).

    Any workaround?

    Thanks

  • Avatar
    Taras Ermoshin

    @Mario Hi!

    This article is devoted to a WordPress website on Plesk which is under development while the production website is working on another server. The article was updated accordingly.

  • Avatar
    Taras Ermoshin

    @Vik Hello!

    As I mentioned above, this article is about a WordPress website on Plesk which is under development while the production website is working on another server. While in the WordPress documentation https://codex.wordpress.org/Changing_The_Site_URL , it is stated that the RELOCATE option is intended to be used when the whole website is moved to another server.

    Additionally, I tried using this option on the test WordPress installation, and the URL wasn't changed to the one with http:// both in WP interface and database when I accessed the login page using http://example.com/wp-login.php.

     

  • Avatar
    Mario

    Hi guys, 

    @Vik, define('RELOCATE',true);  worked perfectly for me, thanks!

    If WP-admin is not accessible, just make the change in phpMyAdmin:

    to Plesk's preview URL:

    Also, when the site is migrated, check wp-config.php, as sometimes they contain:

    define('WP_HOME','https://www.example.com');
    define('WP_SITEURL','https://www.example.com');

    Do open the preview URL in incognito mode/other browser, as sometimes the cache will still redirect to main URL

    Result:

    Hope it helps!

     

  • Avatar
    Robert Asilbekov

    @Mario Proposed workaround will change all links to the Plesk preview URL.

    Regarding "define('RELOCATE',true);" consider the following: 

    == https://codex.wordpress.org/Changing_The_Site_URL

    Important! Leaving the RELOCATE constant in your wp-config.php file is insecure, as it allows an attacker to change your site URL to anything they want in some configurations. Always remove the RELOCATE line from wp-config.php after you're done.

    ==

Please sign in to leave a comment.

Have more questions? Submit a request