0

I am trying to setup a local version of a website that is live, I have downloaded the files and database and believe it is all ready and sorted, but I am having an issue whereby the site is trying to force HTTPS and so all browsers are reporting 'This site can’t provide a secure connection, localhost sent an invalid response.'.

What is the way to handle this? Am I supposed to try to install a certificate?

I am running MAMP for the apache and mysql servers.

2

WordPress keeps WP_HOME and WP_SITEURL in DB, this is set during initial installation and usually is the domain of your website, in your case it is a domain with https.

Your visiting site via local domain, but WordPress redirects to https live domain, causing redirect loop which obviously fails.

To fix this, change WP_HOME and WP_SITEURL values in DB.

Or simply add this to wp-config.php:

define('WP_HOME','http://domain.local');
define('WP_SITEURL','http://domain.local');

Also remember that your browser is caching redirects aggressively. You need to clean cache to see results, or use browser incognito mode.

  • Thanks for the reply, it's not working unfortunately though. I set the changes on both the database and the wp-config file and made sure to use incognito mode. – Josh Feb 16 '18 at 9:39
  • @Josh try to clear the cache then. – sandrodz Feb 16 '18 at 10:07

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.