0

I have a live WP site that uses https, when I move it back to a dev server that's http only I can't access the admin because it get's redirected to https. This only happens when I try to use the admin. Everything works fine in the front end.

So let's say I go to mydevsite.com/wp-admin. I get automatically redirect to https://mydevsite.com/wp-admin. What I am trying to find out is what's causing the browser to redirect my domain to a https. It's clearly something that remained from the live site. I just don't know what.

My troubleshooting:

My first guess is that I needed to update my .htacess file, but the file contains the default wordpress info only:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I also checked functions.php to see if there was anything going on there, but I see nothing related to https.

I also checked the database and did a search for https. I have not found any entries that relate to my website. I specifically checked the options table. No https references there.

I also cleaned transients just in case.

What are other things that I should check?

  • Do a full find and replace on the database, this is a good script: interconnectit.com/products/… and flush the permalinks. – Andrew Bartel Nov 11 '14 at 18:16
  • I have done the database replacement. I know that I can flush the permalinks by visiting the settings page, but in this case I cannot visit that page. How would I go about flushing the permalinks? – gdaniel Nov 11 '14 at 18:32
  • 2
    check the wp-config.php file for FORCE_SSL_ADMIN – karpstrucking Nov 11 '14 at 18:45
  • karpstrucking I just found out about define('FORCE_SSL_ADMIN', true); and then saw your comment. I changed it to false and it solved the issue. Please post your comment as an answer. – gdaniel Nov 11 '14 at 18:46
0

Two things to try:

1 check that your wp-config.php file contains the following:

define('FORCE_SSL_ADMIN', false);

2 if you're in a dev environment, then use wp-cli to run this:

wp search-replace 'https://example.com' 'http://example.com' --skip-columns=guid
  • Whith --skip-columns=guid, It does not perform substitution in the guid columns, but what is it usefull for please ? – lalebarde Apr 15 '15 at 16:51
  • Found answer : GUID entries are supposed to remain static for things like RSS readers – lalebarde Apr 15 '15 at 16:58

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.