3

I recently set up a live WordPress site on my local environment through Duplicator. I can access the wp-admin but I cannot access the main site as wp redirects the site from http to https automatically. I checked the .htaccess, but no luck. I checked the wp_options table and it has an entry of the site with http not https. Can you tell what seems to be the problem and what files should I be looking at? Thanks.

Edit: I cleaned the browser cache (even ran it on incognito), still no luck.

  • Which browser, which version, and how exactly is the local URL you access the site with? – leymannx Dec 21 '17 at 20:35
  • Also: Did you try different browsers? – leymannx Dec 21 '17 at 20:36
  • You can go to the db and update the site in the options table to first remove https, then investigate options to simulate a cert locally, some simple steps to follow here, but only on your local machine: really-simple-ssl.com/knowledge-base/… – Nathaniel Flick Dec 20 '18 at 20:45
3

Well, at my situation... I downloaded the company website from production to localhost because I was needed to prepare a development environment for some developers. The production is using https:// and at localhost http://, and when I ran it the first time on localhost, it always redirected me to the https://.

And, I have managed to made this working on my localhost simply by adding the following lines in the wp-config.php (my wp version was 4.9.8):

define('FORCE_SSL', false);
define('FORCE_SSL_ADMIN', false);

Good luck!

| improve this answer | |
2

Make sure you don't have installed and activated a plugin that forces a redirection to HTTPS, for example, the Really Simple SSL. If you have one, deactivate it on the localhost by renaming the plugin folder name, e.g. rename it from "really-simple-ssl" to "really-simple-ssl_deactivated". Now you should be able to access your wp-admin URL.

| improve this answer | |
0

Well, if you can access /wp-admin/, the solution is pretty simple - clean your browser cache or try to open your website in incognito tab.

| improve this answer | |
  • Sorry. I should've stated that I tried the things you mentioned, still not working out. – popeye Nov 12 '17 at 15:39
  • Did you make all database replacements? – Misha Rudrastyh Nov 12 '17 at 15:42
  • for that I thought Duplicator takes care of though I checked the wp_options table if registered url is on https, but no it's on http. any other table i should be checking into? – popeye Nov 12 '17 at 15:45
  • Of course, I recommend yo use this tool to generate all database queries for your phpMyAdmin rudrastyh.com/tools/sql-queries-generator – Misha Rudrastyh Nov 12 '17 at 15:46
0

You should comment out these lines in .htaccess file

#RewriteCond %{ENV:HTTPS} !=on
#RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
| improve this answer | |
  • Please edit your answer, and add an explanation: why could that solve the problem? – fuxia Oct 2 '18 at 23:08
0

You can easily do it with wp cli.

  1. Install wp-cli using the instruction here
  2. run wp plugin deactivate really-simple-ssl from terminal.

You can also add autocomplete to your bash terminal so you can easily see suggestion of plugins you have installed.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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