/ โ† Redirect Fixes / Redirect Chain Contains HTTP
In this guide
  1. What the warning means
  2. Where the http hop comes from
  3. How to trace the chain
  4. The key configuration changes
  5. A worked example
  6. The fix, step by step
  7. Edge cases worth knowing
  8. Keeping redirects clean
  9. Questions and answers

What the warning means

A redirect chain is a series of redirects a visitor passes through before reaching a page that loads. The warning redirect chain contains http means at least one step in that series is an insecure http:// address, even though the request started on, or ends up at, a secure https:// one. The classic pattern is:

https://example.com/about    301  โ†’  http://example.com/about/
http://example.com/about/    301  โ†’  https://example.com/about/
https://example.com/about/   200

The visitor asked for a secure page and was sent back to the insecure version for one hop before being sent forward again. Three things go wrong:

Browsers can also show a warning when a form on a secure page submits to an address that redirects through http, which stops sign-ups and checkouts.

Where the http hop comes from

CauseHow it shows in the chainWhere to fix it
Trailing-slash rule written with a full http:// targethttps://โ€ฆ/page goes to http://โ€ฆ/page/Server configuration or .htaccess
www or non-www rule with an http targethttps://example.com goes to http://www.example.comServer configuration, hosting panel
Old page-level redirects saved before the move to httpsA specific old path goes to an http addressRedirect plugin, CMS, .htaccess
CMS site address still set to httpThe CMS redirects to its own canonical http addressCMS settings or database
TLS ended at a CDN or proxy, origin unawareThe origin builds redirects using the scheme it sees, which is httpOrigin configuration, CDN SSL mode
Hard-coded http links in content, menus or sitemapsThe chain starts at http before reaching httpsContent, theme files, sitemap generator

The fifth cause catches many people out. If Cloudflare, a load balancer or a reverse proxy handles https and talks to your server over plain http, the server thinks every request is http. Any redirect it builds with an absolute address, such as adding a trailing slash to a directory, will therefore start with http://.

How to trace the chain

Use curl rather than a browser, because browsers cache permanent redirects and apply HSTS silently, both of which hide hops. This prints every status line and Location header in order:

curl -sIL https://example.com/about | grep -iE '^(HTTP/|location:)'

Typical output for the problem looks like:

HTTP/2 301
location: http://example.com/about/
HTTP/1.1 301 Moved Permanently
Location: https://example.com/about/
HTTP/2 200

The protocol switch from HTTP/2 to HTTP/1.1 is a clue: the middle hop was served over plain http. To see just the hop count and the final address:

curl -sIL -o /dev/null -w '%{num_redirects} redirects, final: %{url_effective}\n' https://example.com/about

Test every starting variant, because each can have its own chain:

for u in http://example.com/about https://example.com/about \
         http://www.example.com/about https://www.example.com/about; do
  echo "== $u"; curl -sIL "$u" | grep -iE '^(HTTP/|location:)'
done

Once you know which hop writes http, look at the response headers for that hop. A Server: cloudflare or cf-ray header means Cloudflare answered; x-redirect-by: WordPress or a plugin name means the CMS did; a plain Server: nginx or Apache points at the server configuration.

The key configuration changes

Apache and .htaccess

Force https and the preferred host in a single rule, placed before any other redirects:

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

Then search the rest of the file for any target starting http:// and change it to https, or to a relative path such as /new-page/. The Apache redirects guide covers ordering in more detail.

nginx

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

server {
    listen 443 ssl;
    server_name www.example.com;
    absolute_redirect off;
    # trailing slash rule, now pointing at https
    rewrite ^([^.]*[^/])$ https://$host$1/ permanent;
}

absolute_redirect off makes the redirects nginx generates itself, such as directory slashes, use a relative Location, so they cannot pick up the wrong scheme. On Plesk, put these rules in Additional nginx directives; see redirects on Plesk.

WordPress

Check and correct the site address with WP-CLI, then rewrite old links in the database, always with a dry run first:

wp option get home
wp option get siteurl
wp option update home 'https://www.example.com'
wp option update siteurl 'https://www.example.com'
wp search-replace 'http://www.example.com' 'https://www.example.com' --skip-columns=guid --dry-run

If WordPress sits behind a proxy that ends TLS, add this to wp-config.php above the line that says to stop editing, so it knows the request was secure:

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

Cloudflare

Set the SSL/TLS mode to Full (strict) rather than Flexible, so Cloudflare connects to your server over https and the origin sees secure requests. Check any Redirect Rules for targets that begin with http. The Cloudflare redirects guide explains rule order.

A worked example

An audit flags https://example.com/about as a redirect chain containing http. Tracing it with curl shows three hops ending at https://www.example.com/about/, with the first hop going to http://example.com/about/.

The nginx configuration contains this trailing-slash rule, written years ago when the site ran on http:

rewrite ^([^.]*[^/])$ http://$host$1/ permanent;

Its target is hard-coded to http, so the server sends secure visitors to the insecure address, the http server block sends them to https on www, and only then do they reach the page. The rule is changed to send visitors to the final address in one hop:

rewrite ^([^.]*[^/])$ https://www.example.com$1/ permanent;

After nginx -t and a reload, curl shows one 301 from https://example.com/about straight to https://www.example.com/about/, then a 200. The same mistake in Apache usually appears as a RewriteRule with an http:// target, and the fix is the same: point it at the final https URL.

The fix, step by step

Step 1

Trace the flagged URL with curl

Run curl -sIL on the flagged URL and filter for the status lines and Location headers. Read each hop in order and note which one points to an http:// address. Repeat for the http, https, www and non-www versions of the same path, because each can follow a different chain. You have the right starting point when you can name the exact hop that writes http and the response that comes before it.

Step 2

Identify which layer wrote the http hop

Look at the headers on the response that redirected to http. A cf-ray header points to Cloudflare, an x-redirect-by header points to WordPress or a plugin, and a plain nginx or Apache server header points to the server configuration or .htaccess. Check that layer for a rule matching the path. Confirm you have found it by temporarily disabling that single rule on a staging copy and seeing the hop disappear.

Step 3

Rewrite the rule to target the final https URL

Edit the rule so its target is the final address, starting with https:// and using the preferred host, or a relative path such as /about/. Combine the https and host rules into one rule that runs first, so any variant reaches the final URL in a single hop. Test the configuration with nginx -t or apachectl configtest before reloading, then rerun curl to confirm only one 301 remains.

Step 4

Fix the scheme behind a CDN or proxy

If a CDN or proxy handles https and the origin sees plain http, the origin will keep building http redirects. On Cloudflare, set SSL/TLS to Full (strict) with a valid certificate on the origin. On nginx, add absolute_redirect off. For WordPress, read the X-Forwarded-Proto header in wp-config.php so it knows the request was secure. Retest directory URLs, which are the usual victims, with curl.

Step 5

Set the CMS site address to https

In WordPress, open Settings, then General, and make sure WordPress Address and Site Address both start with https and use the preferred host. Other systems have a similar base URL setting. If the fields are locked, look for WP_HOME and WP_SITEURL in wp-config.php. Confirm with wp option get home and by loading a page and checking that links in the source now start with https.

Step 6

Replace http links across the site

Search the database and theme files for your domain with http:// in front. In WordPress run wp search-replace with --dry-run first, skipping the guid column, then run it for real after a backup. Update menus, canonical tags, hreflang tags and sitemap generator settings too. Confirm by viewing the page source and the sitemap and finding no http links to your own pages.

Step 7

Retest every variant and the whole site

Run the curl loop over the four host and scheme variants of several key paths, including the home page, a directory URL and an old campaign URL. Each should reach its final https page with at most one redirect, and none should pass through http. Then run a full redirect check across the site to catch chains on paths you did not test by hand, and fix any that remain.

Step 8

Turn on HSTS once everything is https

When every page and asset loads over https, add a Strict-Transport-Security header, starting with a short max-age such as 300 seconds. Check that nothing breaks, then raise it to 31536000 seconds. Browsers that have seen the header go straight to https on later visits, removing the first http hop for returning visitors. Confirm with curl -sI that the header appears on https responses.

Edge cases worth knowing

โš ๏ธ Do not fix the chain by adding another redirect on top of it. Correct or remove the rule that writes http, or the chain simply gets longer.

Keeping redirects clean

When every hop is https and each old URL reaches its destination in one step, lock the result in:

  1. Add an HSTS header once https works across the whole site, starting with a short max-age and raising it to a year when you are confident: Strict-Transport-Security: max-age=31536000; includeSubDomains. See HSTS missing from an https server.
  2. Write new redirects with relative targets such as /new-page/ where your platform allows, so they always keep the current scheme and host.
  3. Keep redirects in one place, either the server, the CMS or the CDN, not spread across all three.
  4. Re-run a redirect check after any hosting move, CDN change or plugin update. The redirect chains guide covers longer chains of every kind.
Questions and answers

1. What does redirect chain contains http mean?

It means a request passes through at least one insecure http address on its way to the final page, for example from https to http and back to https. The http step is unencrypted, adds delay and can be intercepted, which defeats the purpose of using https. It usually comes from a redirect rule written with a hard-coded http target, a CMS site address still set to http, or a server behind a CDN that thinks every request arrived over http.

2. Is an http hop in a redirect chain bad for SEO?

It is a mild problem for SEO and a bigger one for security and speed. Google follows the chain and usually indexes the final https page, so rankings are rarely lost directly. But every extra hop wastes crawl effort, slows the first page load for visitors and makes it harder for search engines to settle on one URL. Insecure hops also risk browser warnings on forms. Fixing it is quick, so it is worth doing.

3. How do I find which rule is causing the http redirect?

Trace the URL with curl and look at the response that sends you to the http address. Its headers usually show which layer answered: a cf-ray header means Cloudflare, an x-redirect-by header means WordPress or a plugin, and a plain nginx or Apache server header means the server configuration or .htaccess file. Search that layer for a rule matching the path or containing an http target, and test it by changing that one rule.

4. Why does my browser not show the http hop that the audit finds?

Your browser has probably cached the redirect or already received an HSTS header from your site. With HSTS, the browser upgrades any http address to https internally before sending the request, which appears in DevTools as a 307 Internal Redirect. First-time visitors and crawlers do not have that stored rule, so they still make the real insecure request. Test with curl, which does not cache redirects, to see what new visitors experience.

5. Does Cloudflare Flexible SSL cause http redirects?

It often does. In Flexible mode, Cloudflare talks to your server over plain http, so your server believes every request is insecure. Any redirect it builds with a full address, such as adding a trailing slash, will start with http, and a rule forcing https on the server can cause a loop instead. Switch the SSL/TLS mode to Full (strict) after installing a valid certificate on the origin, and the origin will see secure requests.

6. Should I turn on HSTS to fix a redirect chain with http?

Turn on HSTS after you fix the chain, not instead of fixing it. HSTS makes browsers that have already visited your site go straight to https, so they skip the insecure hop. But first-time visitors and most crawlers still follow the real chain, and HSTS hides the problem from your own browser testing. Correct the redirect rules first, check every variant with curl, then add HSTS with a short max-age and increase it gradually.

7. How many redirects in a chain are acceptable?

One redirect from any old or variant URL to the final page is the goal. Googlebot follows up to 10 hops, so short chains still work, but each extra hop adds a round trip for visitors and wastes crawl effort. Chains of three or more usually mean old rules stacked on new ones and should be flattened. Make sure every rule points directly at the final https address so that no URL ever needs more than a single hop.

Check your redirects for http hops and chains

The redirect checker follows every hop for each URL variant, shows the status code and Location header at each step, and flags any chain that drops to http, so you can see exactly which rule to fix.

Open Redirect Fixes โ†’
๐Ÿ’ฌ Got a problem?
Related Guides: All Redirect Fixes  ·  Fixing Redirect Chains  ·  Fixing HTTPS Redirects  ·  Fixing Mixed Content Redirects  ·  HSTS Missing From an HTTPS Server  ·  Learning Hub

About aiwebpageseo

aiwebpageseo.com is a data-driven SEO and AEO (Answer Engine Optimisation) platform providing a free suite of technical SEO tools. Rather than relying on AI-theorised assumptions, the platform analyses live URL performance, delivering objective diagnostics, page speed metrics, CLS debugging, and site crawl data alongside actionable technical tutorials.