How to force SSL with .htaccess

You can force an HTTPS connection on your website by adding these rules in your website's .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
The .htaccess file needs to be located inside the site's document root folder. If your website is in a subfolder, then the .htaccess should be placed in the corresponding subfolder.

You can create or edit the .htaccess file either via FTP, or using the File Manager available in cPanel.

  • 0 أعضاء وجدوا هذه المقالة مفيدة
هل كانت المقالة مفيدة ؟

مقالات مشابهة

Do you have Softaculous?

Yes, Softaculous is included with each Dedicated hosting plan. Softaculous has over 300 scripts...

Do you offer free SSL certificates?

Yes, We currently utilize AutoSSL from cPanel, this automatically installs free SSL certificates...

Is a website builder included?

Yes, all cPanel accounts have access to it which is a drag and drop website builder. cPanel's...

Is an outbound email filtering service included?

es, we use MailChannels which is a 3rd party service that is specialized in outbound email...

How To Create an FTP Account in cPanel

An FTP account is used for uploading and managing files on your website. It is automatically...

Powered by WHMCompleteSolution