Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
WordPress is installed on the domain example.com on the Plesk server.
-
The domain example.com is resolved not to the Plesk server - the production version of example.com is working on another server.
-
On the Plesk server, the domain is created for developing the new version of the website.
-
On the Plesk server, in the WordPress dashboard of example.com in Settings > General, the options WordPress Address (URL) and Site Address (URL) are set with
https://
- https://example.com. -
When accessing the WordPress login page using Plesk website preview at http://203.0.113.2/plesk-site-preview/example.com/203.0.113.2/wp-login.php, it is redirected to the production website https://example.com/wp-login.php.
Cause
The options WordPress Address (URL) and Site Address (URL) in the WordPress dashboard are set with https://
.
Resolution
-
Edit the hosts file on your PC so the website example.com is loaded from the Plesk server.
-
Log into the WordPress dashboard of example.com hosted on the Plesk server.
-
Go to Settings > General.
-
Change the values of the options WordPress Address (URL) and Site Address (URL) to http://example.com.
-
Click Save Changes.
Additional information
[FIXED BUG] Website preview URL is automatically redirected to the main website URL
Comments
8 comments
If we cant login to wordpress's control panel, we can not access to the WordPress dashboard Settings > General section.
Hello @Vik, in this article WordPress control panel is accessible.
Could you, please, share the details, is there any error message shown for you?
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)
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
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
@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.
@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.
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:
Do open the preview URL in incognito mode/other browser, as sometimes the cache will still redirect to main URL
Result:
Hope it helps!
@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.