I’m having issues with my mod_rewrite to SSL while keeping my other rules. I need all pages to be on SSL, but by adding the rule it created a redirect loop.
Here is what I have so far:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule (.*) https://www.domain.com/ [R=301]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteBase /
# Sign up
RewriteRule ^sign-up/$ /register.php [NC]
Where could I be going wrong here? I’ve tried changing the order of the riles but had no luck.
Cheers,
RJ
I figured this out. It turns out it was due to the web servers being behind a load balancer.
So, it took a while to find but if anyone else has a similar issue with multiple servers behind a load balancer, here is what you need:
Thanks, RJ