This has been asked a million times, but I can't seem to find the right search terms. I would like to redirect all request URIs from:
- http:// domain.com/any_string
- http:// www.domain.com/any_string
- https://www.domain.com/any_string
to
The best answer I have found was:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]
But that gives me a redirect loop. Any ideas?