Redirect all HTTP pages to HTTPS

It is recommended [1][2] that all websites use a secure connection via the HTTPS protocol whenever possible. As such all Valcato Hosting accounts include a free SSL certificate for every domain hosted with us, as well as a range of paid enhanced certificates.

You can redirect users who might try visiting your website using an unsecured HTTP connection to use the secured HTTPS connection instead. This is achieved via a .htaccess file.

  1. First, check for the presence of an existing .htaccess file within the /public_html directory
    • If one exists, edit the existing file and append the code below to the end of the file.
    • If no such file exists, create a new file with the name .htaccess and add the code below into it
    RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  2. Finally save the file

Now when visitors go to they will be redirected to use a secure connection at

  • ssl, secure, https, force, certificate
  • 2 Users Found This Useful
Was this answer helpful?

Powered by WHMCompleteSolution