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


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

NOTE:For SSL certificates on WordPress it’s best to take into account a SSL plugin to pressure content material to HTTPS resembling Actually Easy SSL as a substitute.

How one can pressure your guests to make use of your Devoted SSL certificates

When you 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 out there inside the cPanel. You will have to edit the .htaccess file to pressure the re-direct. Relying in your scenario, it’s possible you’ll have to re-direct all internet site visitors, solely a particular area, or a folder to make use of HTTPS.

Redirect All Net Visitors

To pressure all internet visitors to make use of HTTPS, insert the next strains 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 pressure a particular area to make use of HTTPS, use the next strains 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 making an attempt pressure to https. Moreover, it is advisable to substitute www.instance.com together with your precise area identify.

Redirect Specified Folder

If you wish to pressure 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 make sure to substitute www.instance.com/folder together with your precise area identify and folder you wish to pressure the SSL on.

How one can pressure your guests to make use of your Shared SSL Certificates

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

  1. log into your cPanel and entry the redirects part
  2. Set Sort 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 advocate having Redirect with or with out www. chosen, in order that the person shall 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 had been redirecting instance.com to https://secure21.webhostinghub.com/~whhsup5/

You possibly can see under how the rewrite was setup earlier than we clicked “Add”

force_https_cpanel

If you save this redirect, cPanel truly units up the redirect by modifying your .htaccess file. You need not do something farther from right here (apart from experiment). When you had been truly in search of the .htaccess code to carry out this kind 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]

When you want additional help please be happy to ask a query on our help middle internet site.

Leave a Reply

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