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.

  • force https, https
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Can you map my domain/a subdomain to a typepad blog/photo album?

Domains or subdomains can be mapped to blogs or photo albums (or other materials) hosted at...

HOW TO: Combat referer spam/block certain referers

Symptom: A client wishes to deny access to their site (or parts of it) when the traffic is...

HOW TO: Block entire countries from your site

Symptom: A client wishes to block all visitors from a particular country to their site. Can this...

My phpBB forum installation is not accessible

Symptom: Client cannot access phpBB forum installation. Permissions on the forum installation...

Using mod_rewrite and .htaccess

Symptom: Client would like to redirect their main site to a subdomain under it. Using the...