This is an apache question. I set a header in my config files with RequestHeader. (local apache install) I can see that works as per the output of a custom php script to dump headers: the header is there.
However a rule based on that header being present is not fulfilled in .htaccess. The same .htaccess file works as expected on another server.
My added request header doesn't seem to be visible in .htaccess. Any idea?
Apache conf:
RequestHeader set X-Forwarded-Proto "https"
.htaccess:
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
That loops forever. But it works perfectly on a config behind an AWS load-balancer.