1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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]
Contenus pertinents
- demandé il y a 7 mois
- demandé il y a un an
- demandé il y a un an
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 4 mois
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.