Wordpress wp-admin redirects to https

22,342

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/

Share:
22,342
Jetoox
Author by

Jetoox

newbie web developer

Updated on December 14, 2021

Comments

  • Jetoox
    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
    Jetoox almost 12 years
    actually i found out that I messed up my usermeta table. dang.
  • Tomas Eklund
    Tomas Eklund almost 6 years
    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.
  • Vadim Anisimov
    Vadim Anisimov over 5 years
    just update the wp_options table in your database, siteurl cell. Helped me.
  • Tyler Collier
    Tyler Collier over 3 years
    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).
  • Rohit Nishad
    Rohit Nishad about 3 years
    it's working, but I interested to know to why I have to disable SSL(stop forcing SSL) for admin,
  • RickWeb
    RickWeb about 3 years
    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/…
  • Rohit Nishad
    Rohit Nishad about 3 years
    I perform search and replace in my whole site for http to replace with https...... Then how my backend use http?
  • RickWeb
    RickWeb about 3 years
    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.
  • Rohit Nishad
    Rohit Nishad about 3 years
    i use cloudflare with "Always HTTPS"'s setting enable.... i still need to add radiation in .htaccess?????
  • RickWeb
    RickWeb about 3 years
    Are you using the cloudflare CDN? if so you still need setup your host correctly.
  • Junaid
    Junaid about 2 years
    Well in my case I have to set siteurl and name to http://example.com.