How to force your site to redirect to https (SSL)

When you add an SSL certificate to your website, the URL visitors use to view your site changes from HTTP to HTTPS. The 'S' ensures that your connection is encrypted.

After adding an SSL certificate you should force all URLs on your site to automatically redirect to the HTTPS version. For example, if someone visited:

you'd want it to automatically redirect to:

You can make sure your site redirects to the secure URL by creating a configuration file.

What configuration file do I need to create?

This depends on your server type. Most often your server is running Apache. In this case you'd just need to create an .htaccess file.

If your VPS or Dedicated server has been configured to run Nginx instead, you'd create a redirects.conf file. View the links below for further information.

For Apache servers

For Nginx servers

Unless you've manually changed your VPS or Dedicated server to run Nginx, you are using Apache.

Did this article answer your questions?

Article last updated PST.