WordPress http site keeps switching to https after logging in

I’m having this weird issue with a clients WP multi-site. It works correctly until you log in to the admin panel. It then converts the featured images on the homepage posts to https making them appear as dead links. If you log out of WP, this problem still exists.

To fix, I go into MySQL and update the siteurl to be http://www.lovebryan.com instead of https://www.lovebryan.com. The images appear correctly again.

Read More

In my wp-config, I have the following:

define('WP_HOME','www.lovebryan.com');
define('WP_SITEURL','www.lovebryan.com');
define('DOMAIN_CURRENT_SITE', 'www.lovebryan.com');

in my .htaccess I have the following:

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
RewriteRule . index.php [L]

Why does the siteurl keep reverting back to https?

Related posts

1 comment

  1. You need to include http:// within your WP_HOME and WP_SITEURL definitions.

    define('WP_HOME','http://www.lovebryan.com');
    define('WP_SITEURL','http://www.lovebryan.com');
    

    If you still have issues, try also defining the url (with http://) in functions.php of your theme.

    update_option( 'siteurl', 'http://www.lovebryan.com' );
    update_option( 'home', 'http://www.lovebryan.com' );
    

    More information can be found here: https://codex.wordpress.org/Changing_The_Site_URL

Comments are closed.