Redirect traffic to HTTPS and enforce secure access
Updated 3 months ago
All our hosting plans include an SSL certificate to enable secure access to websites.
If you want to redirect all your traffic to the secure HTTPS protocol, you must edit (or create, if it doesn't exist) the file *.htaccess* which is always located in your site's root directory.
Open the .htaccess file and add the following code:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]These lines of code use the mod_rewrite feature to redirect visitors to the secure version of your site from any address.
To prevent the code from failing when you add it, we recommend placing these lines at the beginning of your .htaccess file, above any other rules it contains.
With this code, if your users access your site via an HTTP URL, they will be redirected to HTTPS, removing the insecure-site warning shown by some browsers.
If you'd prefer us to enable it, write to us and we'll take care of everything!