webzod
account

Stop redirecting HTTPS to HTTP on Apache

headers.redirect.https_downgrade · effort: about an hour

Why it matters

The HTTPS homepage sends visitors back to plain http, so the encrypted connection is thrown away and their traffic is exposed again. It usually means the application believes its address starts with http:// or a redirect rule points the wrong way.

The fix

  1. Search the *:443 virtual host and any .htaccess for Redirect or RewriteRule lines whose target starts with http:// and change them to https://.
  2. If Apache proxies to an application, tell it the original scheme with the line below in the *:443 virtual host (mod_headers), then reload Apache.
apache
RequestHeader set X-Forwarded-Proto "https"

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.