Is there a method for redirecting HTTPS domain without a certificate to one with a certificate in Apache 2 or to HTTP?

If no certificate is found, go to HTTP instead.

  • It's the same as any other redirect. Feb 14, 2019 at 22:43
  • But how do I check if its not certified? And initiate the redirect base on that fact Feb 14, 2019 at 23:00
  • 1
    You could check if HTTPS is not enabled with RewriteCond %{HTTPS} !=on.
    – Freddy
    Feb 14, 2019 at 23:34
  • Is this your server? It doesn't have a certificate if you didn't install one. Feb 14, 2019 at 23:41

1 Answer 1


If you don't have a valid TLS certificate for a server / virtual host, browsers won't connect to it without giving a warning.

A TLS connection must be properly set up before the HTTP redirect message can be sent to the client.

I suggest you get a free Let's Encrypt certificate on your server and use HTTPS.

  • I have certificates for all my domains and subdomains. But in the case that someone who thinks www is needed, they might write www.subdomain.example.com and it gives a security warning. I would like to redirect unsecured to anything secure. Feb 16, 2019 at 19:00
  • 1
    Then you need to have a wild card certificate for all the *.subdomain.example.com subdomains. Feb 17, 2019 at 19:16

Not the answer you're looking for? Browse other questions tagged .