Force SSL/HTTPS with mod_rewrite [duplicate]

The following solution works for both proxied and unproxied servers. So if you are using CloudFlare, AWS Elastic Load Balancing, Heroku, OpenShift or any other Cloud/PaaS solution and you are experiencing redirect loops with normal HTTPS redirects, give it a try. RewriteEngine On # If we receive a forwarded http request from a proxy… RewriteCond … Read more

How do you enable mod_rewrite on any OS?

Nope, mod_rewrite is an Apache module and has nothing to do with PHP. To activate the module, the following line in httpd.conf needs to be active: LoadModule rewrite_module modules/mod_rewrite.so to see whether it is already active, try putting a .htaccess file into a web directory containing the line RewriteEngine on if this works without throwing … Read more