Wordpress wp-admin redirects to https
Solution 1
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.
Solution 2
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.
Solution 3
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;
Solution 4
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/
Comments
-
Jetoox over 2 years
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?
-
Jetoox almost 12 yearsactually i found out that I messed up my usermeta table. dang.
-
Tomas Eklund almost 6 yearsJust 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.
-
Vadim Anisimov over 5 yearsjust update the wp_options table in your database, siteurl cell. Helped me.
-
Tyler Collier over 3 yearsBizarrely, my
siteurl
value was set tohttps://example.com
, when I was working on my site locally and pointing my browser athttp://example.test
. I can't explain why, but it was forwarding me tohttps://example.test
. It would have been more of a giveaway to checksiteurl
if it had been trying to forward me tohttps://example.com
. Anyway, after changing mysiteurl
tohttp://example.test
, it worked (did not forward me to https). -
Rohit Nishad about 3 yearsit's working, but I interested to know to why I have to disable SSL(stop forcing SSL) for admin,
-
RickWeb about 3 yearsIt, 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/…
-
Rohit Nishad about 3 yearsI perform search and replace in my whole site for http to replace with https...... Then how my backend use
http
? -
RickWeb about 3 yearsI 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.
-
Rohit Nishad about 3 yearsi use cloudflare with "Always HTTPS"'s setting enable.... i still need to add radiation in .htaccess?????
-
RickWeb about 3 yearsAre you using the cloudflare CDN? if so you still need setup your host correctly.
-
Junaid about 2 yearsWell in my case I have to set
siteurl
andname
tohttp://example.com
.