$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>migration - Wordpress Multisite keeps redirecting to HTTPS|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

migration - Wordpress Multisite keeps redirecting to HTTPS

matteradmin10PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far