Force HTTPS using .htaccess

To force all HTTP Requests to use HTTPS insert the following to your .htaccess file in your public_html 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} [L,R=301]
Was this answer helpful? 1 Users Found This Useful (1 Votes)

Powered by WHMCompleteSolution