Redirect http to https for web visitors

Once the SSL Certificates you have purchased had been installed, you would need to add "s" to the http in to order to use the SSL. The link would now become https://www.yourdomain.com and load securely.

However to force your website visitors to view your website over https, you can alternatively create .htaccess rewrite rules to force your home page to use https. For example, if a visitor access http://www.yourdomain.com, you can force them to https://www.yourdomain.com so that they are always using the SSL certificate.

The .htaccess file is a special Apache file that you can use to manipulate the behavior of your website. These manipulations include things such as redirects that force all of your domain's pages to https.

 

Note: If the .htaccess file is coded incorrectly, it can cause website errors. Please keep in mind that SnapsHosting does not provide direct support regarding the coding of .htaccess files. This resource is for informational purposes only.

 

Redirect all traffic to use HTTPS

In order to redirect all web traffic to use HTTPS, use the following code in your .htaccess file. If you are hosting multiple websites on your account, it is possible to have an .htaccess file for each website. Make sure that you are editing the .htaccess file that is in the root folder where you want the re-direct to occur.

 

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

  • Email, SSL
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Generating a Certificate Signing Request (CSR) - CPanel/WebHost Manager

Follow the below instructions to generate a CSR for your website. When you have completed...

Powered by WHMCompleteSolution