How do I force https for my site? (All)

To force https for a site (even if https is already defined in a site or URL setting within an application on the site, such as Wordpress), insert this code into a .htaccess under the /public_html of the site for which forcing https is desired:

 

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This will rewrite any inbound, non-https requests to their https equivalent.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Resellers: How to create custom nameservers

If you have a reseller account you might like to have your own nameservers for your customer's...

How to Create Reseller or Master Reseller in DirectAdmin with DAreseller?

To change a Package as Reseller/Master Reseller Package follow these instructions Go to...

How to create an email account in DirectAdmin?

DirectAdmin is a hosting control panel for Linux server. Please perform the following steps to...

How to host a domain in DirectAdmin?

DirectAdmin is a hosting control panel for Linux server. Please perform the following steps to...

How to create an FTP account in DirectAdmin?

  Perform the following steps to create an FTP Account in DirectAdmin control panel: Login to...