Jump toUpdate content

How to enable HTTPS for webhosting classic

Reviewed on 05 August 2021Published on 05 August 2021

The logcenter allows you to visualize in real-time the error logs of your hosting. This allows you to diagnose quickly problems linked to your code.

Requirements:
  • You have an account and are logged into the Dedibox Console
  • You have created a webhosting Classic

Scaleway Dedibox offers HTTPS on all its webhosting services by default. HTTPS allows you to secure the exchanges between the client (visitor of your site) and the server (our platform) It is usually preferred for online shops, but HTTPS becomes more and more a standard on the web.

The certificate is issued by Let’s Encrpyt an initiative that allows to generate SSL certificates, known by all browsers for free.

Tip:

TLS/SSL is enabled by default for all webhostings and does not require any configuration from you.

Note:

TLS/SSL is only compatible with OS/browsers that support SNI. This means that the following clients cannot connect to sites hosted in HTTPS:

  • Windows XP (IE6/IE7)
  • Android 2.x
  • Versions below iOS 4 (iPhone)

How to force HTTPS for the whole website

To force a site to accept SSL, such as a CMS, simply add the following code to the .htaccess file:

RewriteEngine On
RewriteCond %{HTTP:HTTPS} !on
RewriteRule (.*) https://%{SERVER_NAME}/$1 [QSA,L,R=301]

How to disable HTTPS for the whole website

To disable SSL, you need to put the following code in the .htaccess file

RewriteEngine On
RewriteCond %{HTTP:HTTPS} on
RewriteRule (.*) http://%{SERVER_NAME}/$1 [QSA,L,R=301]

How to troubleshoot HTTPS issues

How to fix the mixed content issue

When using HTTPS, it needs to be used everywhere. It means that all the loaded elements on the webpage (pictures, CSS, JavaScripts) have to be loaded through HTTPS as well.

A website that loads for example JavaScript scripts or external images by http, will display a https alert in the browser (e.g.: “non Secure Content”).

In some cases it could not display it (Chrome did that in some cases).

How to fix the “insecure connection” issue

This may happen for example if the sub-domain does not exist in the certificate.

In this case, you need to add the sub-domain in the console, or if it exists already to add/delete it - or to create another sub-domain (this will force the regeneration of the certificate).

How to fix the “connection error” issue

This error message means that there is no certificate for this domain. You need to verify the DNS records and force the regeneration by creating a sub-domain from the Dedibox console.

How to fix the “too many redirections” issue

When using Wordpress, you may encounter Too many redirections errors in your web browser.

This can be fixed by installing the Really Simple HTTPS plugin.

When using the plugin, make sure that the following lines are not present in your .htaccess file:

RewriteEngine On
RewriteCond %{HTTP:HTTPS} !on
RewriteRule (.*) https://%{SERVER_NAME}/$1 [QSA,L,R=301]
Tip:

If you have installed Wordpress according to the Wordpress documentation, simply replace in the table (prefix)_options the siteurl and home entries from https to http before installing the aforementioned plugin.

See Also