Apache: Use .htaccess to redirect http to https

Posted by Andrew McCombe on Sat Aug 25, 2018

I’m forever having to lookup how to use Apache’s .htaccess to redirect http to https so here it is.

First, make sure you have Apache’s mod_rewrite module enabled.

This will check the request for HTTPS and if it matches will permanently redirect the browser to the https:// url.