How do I Drive my Web site to make use of SSL?


Infrequently we’re requested how one can drive your internet site guests to view your internet site over https. For instance, if a customer entry http://area.com, you possibly can drive them to https://area.com in order that they’re at all times utilizing the SSL certificates.

NOTE:For SSL certificates on WordPress it’s best to contemplate a SSL plugin to drive content material to HTTPS resembling Actually Easy SSL as an alternative.

Methods to drive your guests to make use of your Devoted SSL certificates

If you happen to attempt to setup a Devoted SSL redirect utilizing the identical steps above, cPanel will fail with an error message, just like:

Redirecting to https://www.instance.com/ will trigger a redirection loop as a result of ‘http://instance.com/’

which is situated at /house/whhsup5/public_html/

is above ‘https://www.instance.com/’

which is situated at /house/whhsup5/public_html/

The next modifications to the .htaccess file would require that you simply make use of the edit choices obtainable throughout the cPanel. You will want to edit the .htaccess file to drive the re-direct. Relying in your state of affairs, chances are you’ll must re-direct all internet site site visitors, solely a particular area, or a folder to make use of HTTPS.

Redirect All Net Site visitors

To drive all net site visitors to make use of HTTPS, insert the next traces of code within the .htaccess file in your internet site’s root folder.

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?: Comodo DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Redirect Solely Specified Area

To drive a particular area to make use of HTTPS, use the next traces of code within the .htaccess file in your internet site’s root folder:

RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?: Comodo DCV)?$
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^instance.com [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.instance.com/$1 [R=301,L]

Make sure that to interchange instance.com with the area identify you are attempting drive to https. Moreover, you should substitute www.instance.com along with your precise area identify.

Redirect Specified Folder

If you wish to drive SSL on a particular folder, insert the code under right into a .htaccess file positioned in that particular folder:

RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?: Comodo DCV)?$
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.instance.com/folder/$1 [R=301,L]

Be sure to change the folder reference to the precise folder identify. Then remember to substitute www.instance.com/folder along with your precise area identify and folder you need to drive the SSL on.

Methods to drive your guests to make use of your Shared SSL Certificates

To drive your guests to make use of your Shared SSL certificates:

  1. log into your cPanel and entry the redirects part
  2. Set Kind to Everlasting (301)
  3. Subsequent to http://(www.)? select the area identify you’re working with
  4. Subsequent to redirects to, enter your internet site’s url utilizing the Shared SSL Certificates
  5. We suggest having Redirect with or with out www. chosen, in order that the consumer will probably be compelled to make use of SSL whether or not they use area.com or www.area.com
  6. Guarantee Wild Card Redirect is chosen
  7. Click on Add

When testing, we have been redirecting instance.com to https://secure21.webhostinghub.com/~whhsup5/

You’ll be able to see under how the rewrite was setup earlier than we clicked “Add”

force_https_cpanel

If you save this redirect, cPanel really units up the redirect by enhancing your .htaccess file. You needn’t do something farther from right here (apart from scan). If you happen to have been really on the lookout for the .htaccess code to carry out this sort of redirect, cPanel added the next code to the .htaccess file:

RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?: Comodo DCV)?$
RewriteEngine On
RewriteCond %{HTTP_HOST} ^instance.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.instance.com$
RewriteRule ^(.*)$ “https://secure21.webhostinghub.com/~whhsup5/$1” [R=301,L]

If you happen to want additional help please be at liberty to ask a query on our help middle internet site.

Leave a Reply

Your email address will not be published. Required fields are marked *