Last Updated on April 17, 2021 by Amit
Redirect https to http using htaccess without a valid SSL certificate
One of our blog reader recently asked whether they could redirect redirect https URLs to http for a domain that was indexed as https in search results but now the domain isn’t SSL enabled.
The short answer is No !
You can’t use htaccess or any other server side redirection methods to redirect https if you don’t have a valid SSL cert.
You will get a privacy error “Insecure connection” if you try to use RewriteRule or any other server side redirect in this situation.
The reason why you can’t use mod-rewite to redirect https to http unless you have a valid ssl cert is because SSL certificate is checked by a different module on apache server. mod-ssl an SSL module of Apache is responsible for the SSL handshake verification.
This module runs before the mod-rewite and sends a green signal to mod-rewite if everything is ok with the SSL handshake otherwise if something goes wrong or SSL cert is not found then this module sends a warning to client and stops the execution of URL redirection.
To solve this, the only thing you can do is install a valid ssl cert on the domain. SSL cert doesn’t cost much and there are also free SSL provides like Cloudflare and Letsencript you can get a valid shared ssl cert from them or buy one for your domain.
After installing the ssl cert , you will be able to use RewriteRule directive to manipulate your https URLs.