Redirect http to https with .htaccess

I've recently set up a SSL certificate for one domain and it's somewhat easy if you have the right tutorials, since it depends on what's your setup (Apache, Nginx...)

For my final set up steps I wanted to redirect all incoming traffic to the new and secured https url, to do that after some search this is the best code I could find:

If you're using WordPress put it at the top, be aware that you probably already have this RewriteEngine On line in your .htaccess files.

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

Leave a Reply

Add <code> Some Code </code> by using this tags.