1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
0
When you have a CDN in front of a web-server, you need to examine the content of the X-Forwarded-Proto header that the CDN adds:
You should probably change the line:
RewriteCond %{HTTPS} off
to something like:
RewriteCond %{HTTP:X-Forwarded-Proto} !https
If you also want to have the redirect for traffic that comes in directly and not via the CDN add a second Rewrite Condition as follows:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor einem Jahr
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
still throwing error, too many redirects
Your best bet then to understand what is happening is to turn on mod_rewrite's logging. If you are using Apache 2.4 and up - you need to do this with
LogLevel alert rewrite:trace3
in your main config (not .htaccess). Refer to https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#logging. Then examine your logs to see why and at what step it keeps redirecting.