Contact Us

Switching your WordPress site from HTTP to HTTPS is the best thing you can do for security, SEO, and user trust. But sometimes, after installing SSL, WordPress redirects incorrectly, causing issues such as:

  • Infinite redirect loops

  • Too many redirects error

  • Site stuck on HTTP

  • Site stuck on HTTPS

  • Some pages redirect, others don’t

  • Mixed content warnings

  • Images loading over HTTP

  • Wrong canonical URLs

  • Redirect chain errors

If your site is redirecting HTTP → HTTPS incorrectly, don’t worry — you’re not alone. This is one of the most common SSL-related WordPress issues.

In this guide, you’ll learn exactly how to fix every type of incorrect HTTPS redirect, including:

✔ .htaccess misconfigurations
✔ wp-config.php issues
✔ Cloudflare wrong SSL mode
✔ Reverse proxy issues
✔ Database URLs not updated
✔ Hosting-level HTTPS forcing
✔ Plugin conflicts
✔ Hard-coded HTTP links
✔ Mixed-content breaking redirects

This is the most complete and updated guide for 2025, and everything is copy-paste ready.

Why WordPress Redirects Wrongly After Enabling HTTPS

When you migrate to HTTPS, multiple layers control URL rewrites:

  • WordPress settings

  • Database URLs

  • .htaccess rules

  • wp-config constants

  • Server configuration

  • CDN (Cloudflare)

  • Reverse proxy (NGINX + Apache)

  • Plugins

  • Theme hard-coded URLs

If even one layer conflicts, the redirect becomes incorrect.

Example of common problems:

1. Infinite Redirect Loop

HTTP → HTTPS
HTTPS → HTTP
Repeats forever.

2. Too Many Redirects

Browser shows:
ERR_TOO_MANY_REDIRECTS

3. HTTPS Works But Images Still Load Over HTTP

Mixed content blocks the secure version.

4. www vs non-www clash

http://www.example.com
https://example.com
Conflict happens → loop.

5. Cloudflare “Flexible SSL” Loop

Tells Cloudflare HTTPS but server still expects HTTP.

6. Reverse Proxy (e.g., Load Balancer) Incorrect Forwarding

WordPress sees HTTP even when HTTPS is being used.

Let’s fix all of this step-by-step.

1. Fix HTTPS Redirects in WordPress General Settings

Go to:

Settings → General

Ensure both fields match exactly:

WordPress Address (URL)
https://yourdomain.com

Site Address (URL)
https://yourdomain.com

Important:

No HTTP
No mismatched URLs
No mixed www and non-www
No trailing slash

If you can’t access the admin area, force them in wp-config.php:

define('WP_HOME', 'https://yourdomain.com');
define('WP_SITEURL', 'https://yourdomain.com');

Clear browser cache.

If redirect loop persists → continue below.

2. Fix .htaccess Redirect Rules (Most Common Issue)

Your .htaccess file may contain:

  • Duplicate redirect rules

  • Old plugin rules

  • Wrong HTTPS conditions

  • Conflicting redirect loops

Use the official recommended HTTPS redirect:

# BEGIN WordPress Redirect to HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END WordPress Redirect to HTTPS

Now ensure the correct WordPress core rules exist below it:

# 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

Remove these if present:

  • Multiple redirect blocks

  • Redirecting to HTTP

  • Redirecting to www when your domain is non-www

  • Old plugin redirects

Fixing www vs non-www redirect conflict:

For non-www primary domain:

RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ https://example.com/$1 [L,R=301]

For www primary domain:

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]

3. FIX: Cloudflare Incorrect HTTPS Redirect

If you use Cloudflare → MOST redirect loops happen because of Wrong SSL Mode.

Go to:

Cloudflare → SSL/TLS Settings → Overview

Set SSL to:

Full (best)
Full (Strict) (best if your host supports it)

Never use:

Flexible SSL → Causes redirect loops
Off → Causes HTTP/HTTPS mismatch
Strict if host lacks valid origin certificate

Also disable conflicting settings:

SSL/TLS → Edge Certificates → Always Use HTTPS → OFF
(If you’re already forcing HTTPS via .htaccess)

Rules → Page Rules → Remove ANY HTTP → HTTPS forcing
(It creates double redirects)

4. Fix Reverse Proxy / Load Balancer HTTPS Loop

If your site is behind:

  • Cloudflare

  • NGINX reverse proxy

  • AWS Load Balancer

  • LiteSpeed

  • HAProxy

  • Traefik

Your server may think visitor is using HTTP even when it’s HTTPS.

Add this to wp-config.php:

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}

This alone fixes:

SSL loops
Mixed content
wp-admin redirect loops
Cloudflare Flexible mode behave weirdly

5. Fix Database URLs Still Using HTTP

If your database still contains:

http://yourdomain.com

Your site will partially redirect, causing:

  • Images over HTTP

  • CSS/JS over HTTP

  • Canonical tags incorrect

  • Internal links redirect wrong

Use WP-CLI (recommended):

wp search-replace 'http://yourdomain.com' 'https://yourdomain.com' --skip-columns=guid

Or use phpMyAdmin:

Run SQL query:

UPDATE wp_options SET option_value = replace(option_value, 'http://yourdomain.com', 'https://yourdomain.com') WHERE option_name='home' OR option_name='siteurl';

UPDATE wp_posts SET guid = replace(guid, ‘http://yourdomain.com’, ‘https://yourdomain.com’);

UPDATE wp_posts SET post_content = replace(post_content, ‘http://yourdomain.com’, ‘https://yourdomain.com’);

UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘http://yourdomain.com’, ‘https://yourdomain.com’);

6. Fix Mixed Content Causing Redirect Errors

If some assets load over HTTP, browser may block HTTPS page, causing a broken redirect.

Search your theme for hard-coded HTTP URLs:

<img src="http://example.com/wp-content/uploads/...">
<link rel="stylesheet" href="http://...">
<script src="http://..."></script>

Fix by replacing:

http:// → https://

Or make URLs dynamic:

<?php echo get_template_directory_uri(); ?>

7. Fix Plugin Conflicts Breaking Redirects

Common plugins that often break redirects:

  • Really Simple SSL

  • Redirection

  • Yoast SEO (if redirect set incorrectly)

  • WP Fastest Cache

  • LiteSpeed Cache

  • SiteGround Optimizer

  • WP Super Cache

  • W3 Total Cache

  • Hummingbird

  • Jetpack

Disable ALL plugins temporarily:

Rename the folder:

wp-content/plugins → plugins_backup

If redirect works → plugin conflict confirmed.

Re-enable plugins 1 by 1 until you find the culprit.

8. Fix Incorrect Hosting-Level Redirects

Some hosts force HTTPS automatically:

  • SiteGround

  • Hostinger

  • Bluehost

  • GoDaddy

  • Kinsta

  • WP Engine

Check:

Control Panel → Redirects or HTTPS Settings

Disable duplicate HTTPS forcing, especially if .htaccess already forces HTTPS.

9. Fix NGINX Users (No .htaccess)

If you use NGINX, add this redirect:

server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}

Reload server:

sudo service nginx reload

10. Fix “Too Many Redirects” Instantly (Emergency Quick Fix)

Add this to wp-config.php:

define('FORCE_SSL_ADMIN', true);
$_SERVER['HTTPS'] = 'on';

Clear cookies → Reload site.

This solves redirect loops in seconds.

11. Fix Incorrect Elementor, Divi or Page Builder URLs

Page builders store absolute URLs.

Regenerate CSS files:

Elementor

Elementor → Tools → Regenerate CSS & Data

Divi

Divi → Theme Options → Builder → Advanced → Static CSS File → Clear

WPBakery

Re-save page.

12. Reset All Redirects (Final Clean Approach)

  1. Remove all redirects in .htaccess

  2. Remove all Cloudflare redirects

  3. Disable redirect plugins

  4. Clear cache

  5. Add only the official HTTPS rule

Your .htaccess should only contain:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Final Thoughts

Fixing incorrect WordPress HTTP → HTTPS redirects can be frustrating because the issue may come from multiple layers.

But once you follow this guide:

✔ Your redirects will work properly
✔ You’ll avoid loops and chains
✔ Your entire site will be secure
✔ Mixed content will be gone
✔ Search engines will index HTTPS only
✔ Website speed will improve
✔ SEO rankings will increase

FAQs

1. Why is WordPress stuck redirecting incorrectly after enabling HTTPS?

Because multiple redirect sources conflict, such as .htaccess rules, Cloudflare settings, database URLs, plugins, or hosting-level redirects.

2. How do I fix WordPress HTTPS redirect loops?

Correct your .htaccess, update wp-config HTTPS settings, ensure Cloudflare uses “Full SSL,” and check database URLs for HTTP.

3. Should I use plugins for HTTPS redirection?

No. It’s better to force HTTPS via .htaccess or server-level rules for speed and accuracy.

4. Why do images still load over HTTP even after SSL?

Because they are hard-coded in the database or theme. Run search-replace to fix old URLs.

5. Does Cloudflare cause redirect loops?

Yes — especially when using “Flexible SSL.” Use “Full” or “Full (Strict)” instead.

Subscribe To Our Newsletter & Get Latest Updates.

Copyright @ 2025 WPThrill.com. All Rights Reserved.