Hulp nodig? Wij helpen graag

How do I automatically use HTTPS?

SSL-certificates are required to setup an secure connection, by doing this you prevent the ability for thirdparties to see the data send between visitors and the server. SSL certificates are not automatically used by default. You must first replace http:// in the address bar with https://. In this article, we explain how to make sure that your website automatically uses https://.

Important

In this article, we use a .htaccess file to automatically use HTTPS. You must set this file for every website individually (ie per domain and subdomain). If there is already a .htaccess file in your web space, place the content that we discuss in this article above all other lines.

Steps

Step 1. Log in to cPanel.

Step 2. Under File, click File Manager.

Step 3. Navigate to the document root of the relevant domain name. For your primairy domain this is the public_html.

Step 4. In the upper right, click Settings and check Show hidden files (dotfiles). Click Save.

Step 5. If there is already a .htaccess file, click the right mouse button and click Edit. If there is no .htaccess file, click on + File at the top left. Enter .htaccess as a new filename.

Step 6. Paste the following code into the .htaccess file:

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\Comodo\DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/.+$
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Step 7. Click Save Changes in the upper right. Anyone who does not enter https:// will automatically be redirected.

Also read: How do I use HSTS?

 

Frequently asked questions

Why don't I see a green padlock after this change?

If you made this change, but don't see a secure connection there is probably something wrong with your webstie. What exactly you usually can figure out with a test on whynopadlock.com. If you follow the instructions on that page to run a test, they will show some recommendations that can help you ensure the connection will be secure.

WordPress Really Simple SSL

WordPress websites can use a plugin to automatically activate SSL. A plugin we have had good experience with in the past is Really Simple SSL. For more information about this plugin we refer to the documentation of Really Simple SSL.

Also read: How do I install a WordPress plugin?

 

This knowledgebase article was last updated on: 1 August 2019

Heeft dit artikel je geholpen?

Status

Ga naar onze statuspagina voor een overzicht van recente storingen en onderhoud.

Openingstijden

Maandag — vrijdag 9:00 — 17:00