How to Force Your Website to Load with Secure Pages

Apache-logo.png

In this short lesson I will show you how to use your htaccess file to force your website to load in secure mode. In other words, make a visit to http://coding.academy be forced to https://coding.academy

The process is actually fairly straightforward.

Go to the root folder of your website and create a htaccess file if one does not already exist. Note that it needs to be called .htaccess (note the period at the front of the name).

Inside the file you need to add the following code:

Be careful if coying the code so that you do not introduce any line breaks.

That's it!

Give it a try.