Redirect traffic to HTTPS and enforce secure access
Updated last month
All our hosting plans include an SSL certificate as part of their features 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 does not exist) the *.htaccess* file, which is always located in the root directory of your site.
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 function to redirect access to the secure version from any address.
To prevent the code from failing when it is added, we recommend placing these lines at the beginning of your .htaccess, above any other rules it may contain.
With this code, if your users access your site via an HTTP URL, they will be redirected to HTTPS, removing the insecure site warning displayed by some browsers.
If you would prefer us to activate it, write to us and we will take care of everything!