migration - Wordpress Multisite keeps redirecting to HTTPS

admin2025-06-04  2

I would like to create a local development environment from my production, multisite, WordPress website. I have used the Migrate DB plugin with the following search and replace settings:

//domain  -> //domain.local

 -> 

 -> 

/data/sites/web/domain -> /var/www/html

Now it works all fine, locally, but without multisite enabled. As soon as Multisite is enabled it still tries to redirect me to HTTPS.

So as soon as I enable these settings in wp_config.php, I am not able to login at /wp-admin anymore:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'domain.local');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

And it redirects me from /wp-admin to /wp-login.php?redirect_to=http%3A%2F%2Fdomain.local%2Fwp-admin%2F&reauth=1 which causes an ERR_CONNECTION_CLOSED

Any ideas what this is causing? Further I tried:

  • empty all active_plugins cells in every wp_options table (so also for every subsite), so there should not be any active.
  • Add define('WP_CACHE', false); at the top of wp_config.php

Not sure if there could be any other setting specifically for https in Multisites. As I just told, without multisite enabled in wp-config.php I am able to reach /wp-admin, but with multisite enabled I am not and it's trying to redirect me to an https domain which results in an error.

EDIT:

I seem to have found the issue, I have moved all plugins to a separate folder (temporarily) and now the website works. I am able to reach wp-admin without any issues. So a plugin still seem to be the problem, even though I have disabled all plugins via the database.

I would like to create a local development environment from my production, multisite, WordPress website. I have used the Migrate DB plugin with the following search and replace settings:

//domain  -> //domain.local

https://domain -> http://domain.local

https://domain.local -> http://domain.local

/data/sites/web/domain -> /var/www/html

Now it works all fine, locally, but without multisite enabled. As soon as Multisite is enabled it still tries to redirect me to HTTPS.

So as soon as I enable these settings in wp_config.php, I am not able to login at http://domain.local/wp-admin anymore:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'domain.local');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

And it redirects me from http://domain.local/wp-admin to https://domain.local/wp-login.php?redirect_to=http%3A%2F%2Fdomain.local%2Fwp-admin%2F&reauth=1 which causes an ERR_CONNECTION_CLOSED

Any ideas what this is causing? Further I tried:

  • empty all active_plugins cells in every wp_options table (so also for every subsite), so there should not be any active.
  • Add define('WP_CACHE', false); at the top of wp_config.php

Not sure if there could be any other setting specifically for https in Multisites. As I just told, without multisite enabled in wp-config.php I am able to reach http://domain.local/wp-admin, but with multisite enabled I am not and it's trying to redirect me to an https domain which results in an error.

EDIT:

I seem to have found the issue, I have moved all plugins to a separate folder (temporarily) and now the website works. I am able to reach wp-admin without any issues. So a plugin still seem to be the problem, even though I have disabled all plugins via the database.

Share Improve this question edited Jan 18, 2019 at 12:29 Erik van de Ven asked Jan 18, 2019 at 10:32 Erik van de VenErik van de Ven 1011 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The reason why my website was still redirecting to HTTPS was because of a plugin. The plugin was disabled, by emptying the database cell which contains the "active plugins", but still it was overruling every WordPress setting so it seemed. Every setting in wp-config.php which should overrule database settings or disabling/removing cache, didn't worked out. I tried literally everything which can be found on most blogs, the WordPress documentation etc.

But moving all plugins from wp-content/plugins to a temporary folder called wp-content/plugins-backup helped me to reach the admin page and by moving the plugins back to the wp-content/plugins folder, one by one (or a few at a time), helped me figuring out which plugin was the problem.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748990948a315437.html

最新回复(0)