Redirect all HTTP pages to HTTPS

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 http://yoursite.com they will be redirected to use a secure connection at http://yoursite.com

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

Related Articles

Executing PHP scripts in a cron job

Using a cron job is a great way to automatically perform a task at regular intervals all the way...

Increasing PHP upload limit

By default the maximum file size you can upload via PHP is 2MB, but sometimes this isn't enough....

Checking PHP Settings

You can check the PHP settings for your account, or a particular directory in your account using...

Changing PHP Settings - Advanced

Our PHP configuration has been set to allow as many scripts as possible to run, but there are...

SSH Access

Secure Shell Handler is a command-line interface to the server, the majority of tasks possible...