How to force visitors to use HTTPS

How to make visitors use HTTPS when they use the domain “” or “”? If they don’t add “https://” in the beginning, they will use HTTP.

Error Message

no error

Other Information


Make a file in htdocs called .htaccess, and put this in there.

RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

If you use CloudFlare, there is a setting for that in SSL/TLS.


It worked, THANKS!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.