17

I have this problem, when I try to login in my wp dashboard (wp-admin) it redirects to a https connection.

when i type websitename.com/wp-admin, it'll show the login page but the url has is different. it says, websitename.com/login.php?redirect_to=https://websitename.com&reauth=1.

I never did anything odd, i was just editing the plugin and later on this thing happens.

What's the problem with this?

Anyone can help?

4 Answers 4

36

So if you are having this issue only when you go to ../wp-admin then it is because you have force ssl admin set to true. You can find this in wp-config.php in the root of your WordPress site, you need to set this option to false.

define('FORCE_SSL_ADMIN', false);

I am assuming your siteurl in the wp_options table in the WordPressdatabase is set to a http:// address.

6
  • it's working, but I interested to know to why I have to disable SSL(stop forcing SSL) for admin, Feb 22, 2021 at 13:45
  • It, usually due to incorrect SSL / URL setup, now your site and admin backend are working on http you can troubleshoot your problem, get https set backup, once https is working again you can force the site to use SSL only. Guide here wpbeginner.com/wp-tutorials/…
    – RickWeb
    Feb 23, 2021 at 16:24
  • I perform search and replace in my whole site for http to replace with https...... Then how my backend use http? Feb 23, 2021 at 18:10
  • I am guessing because your .htaccess file is still allowing it to be served. If you follow the guide linked here wpbeginner.com/wp-tutorials/… it goes through everything you need to change to force https and stop people accessing your site via http.
    – RickWeb
    Feb 23, 2021 at 19:21
  • i use cloudflare with "Always HTTPS"'s setting enable.... i still need to add radiation in .htaccess????? Feb 23, 2021 at 21:20
21

open your wp_options table in database.

Search for siteurl and check option value of siteurl. I think that url is redirected to https. Change it to http.

5
  • 1
    actually i found out that I messed up my usermeta table. dang.
    – Jetoox
    May 14, 2012 at 8:49
  • Just this once I used Plesk to install WordPress on a site. And yes, it had set up the "siteurl" and "home" options in the wp_options table with "https", although https wasn't activated for the site. Jun 4, 2018 at 8:24
  • just update the wp_options table in your database, siteurl cell. Helped me. Feb 3, 2019 at 8:38
  • Bizarrely, my siteurl value was set to https://example.com, when I was working on my site locally and pointing my browser at http://example.test. I can't explain why, but it was forwarding me to https://example.test. It would have been more of a giveaway to check siteurl if it had been trying to forward me to https://example.com. Anyway, after changing my siteurl to http://example.test, it worked (did not forward me to https). Oct 7, 2020 at 16:59
  • Well in my case I have to set siteurl and name to http://example.com.
    – Junaid S.
    Feb 22, 2022 at 10:27
6

Old question, but something has never been mentioned here: any user can choose to use SSL.

You may want to check your wp_usermeta table:

mysql> select * from wp_usermeta where meta_key = 'use_ssl';
+----------+---------+----------+------------+
| umeta_id | user_id | meta_key | meta_value |
+----------+---------+----------+------------+
|        9 |       1 | use_ssl  | 1          |
+----------+---------+----------+------------+

use_ssl need to be set to 0 if you don't want to be redirected (useful for local development):

update wp_usermeta set meta_value = 0 where meta_key = 'use_ssl' and user_id = YOUR_ID;
2

There is a bug in chrome and chromium 44.0.2403.89 which also causes this bug. Especially to sites using Woocomerce. But all frameworks using PHP could be effected.

This is not the same problem as the author but i think google will lead those of you that have the same problem as me here anyway.

The description of problem which is found and described in the link below is that chrome started to add 'HTTPS:1' header to all requests. Which leads to a problem with PHP way to handle headers and checking ssl.

There is a patch on the way that renames the header 'HTTPS' to 'upgrade-insecure-requests'.

https://ma.ttias.be/chrome-44-sending-https-header-by-mistake-breaking-web-applications-everywhere/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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