Force all requests to HTTPS on Cloudways
I found it a little difficult to get a proper HTTPS redirect working on Cloudways. All of the other mod_rewrite rules for checking non-SSL traffic seemed to end in a redirection loop. This turns out the be the code that works: # HTTPS redirect <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] […]