Redirect HTTPS straight to the other host's HTTPS page on Apache
Why it matters
The HTTPS homepage of this host redirects visitors to the plain http page of its www or non-www twin, although the twin serves the site over https itself and visitors lose the encrypted connection on the way. Point the redirect at the twin's https address instead.
The fix
- In the *:443 virtual host for example.com and in any .htaccess, change the Redirect or RewriteRule whose target starts with http:// so it points at the https:// address of the other host (www.example.com or example.com), then reload Apache.
apache
<VirtualHost *:443> ServerName example.com # SSLEngine and certificate lines as before Redirect permanent / https://OTHER_HOST/ </VirtualHost>
The examples use example.com. Replace it with your own domain.
Related
- Reported by the HTTP to HTTPS redirect check
- Serve the site over HTTPS
- Stop redirecting HTTPS to HTTP
- Redirect HTTP to HTTPS
- Redirect HTTP to HTTPS instead of answering an error
- Check that browsers are redirected from HTTP to HTTPS
- Fix the broken HTTPS redirect chain
- Shorten the redirect chain
- Fix the HTTP redirect chain
- Redirect HTTP straight to HTTPS
- Answer HTTP with a redirect to HTTPS
- Redirect www and apex to one host
- Make the www or apex name work over HTTPS
Scan your domain to see whether this applies to you.