Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress always redirects to https after copying to localhost

When I copy my wordpress installation from server to a local webserver (MAMP) and try to access localhost:8888, it always redirects http to https. So I always get an ERR_SSL_PROTOCOL_ERROR.
I can't find the setting for this anywhere – neither in the database nor somewhere else in the wordpress files. Can anybody help?

like image 235
Tim Kohlen Avatar asked Apr 21 '18 10:04

Tim Kohlen


2 Answers

Make sure that WP_HOME and WP_SITEURL are set to addresses that start with http, not https.

These settings should be located in wp-config.php.

define('WP_HOME','http://localhost:8888');
define('WP_SITEURL','http://localhost:8888');

Make sure you aren't telling WordPress to force SSL for admin and login.

define('FORCE_SSL_LOGIN',false);
define('FORCE_SSL_ADMIN',false);
like image 69
rb- Avatar answered Oct 27 '22 16:10

rb-


I tried all the above suggestions and nothing worked. In my case some plugin was probably causing this. It started working after disabling the plugin directory by renaming it to 0_Plugins.

Now I have to manually figure out which of the plugins was causing this.

Thanks for the other tips.

like image 21
Herbalizer Avatar answered Oct 27 '22 17:10

Herbalizer