[CPANEL-22603] HTTPS Redirect Odd Behavior
Hi.
Please, I need your insight on this.
Problem:
HTTPS redirection is not working when it set using cPanel Redirects.
The generated rule looks like this:
Temporary Solution: For this to work, we remove: `RewriteCond %{HTTP:X-Forwarded-SSL} off` from the rule in .htaccess file. Please, what could account for this? Our assumption is that perhaps it is because Apache doesn"t have `X-Forwarded-SSL` variable and so cannot determine whether `RewriteCond %{HTTP:X-Forwarded-SSL}` is ON or OFF and thus give up. Thanks a lot for your help!
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} off
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ "https\:\/\/example\.com\/$1" [R=301,L]Temporary Solution: For this to work, we remove: `RewriteCond %{HTTP:X-Forwarded-SSL} off` from the rule in .htaccess file. Please, what could account for this? Our assumption is that perhaps it is because Apache doesn"t have `X-Forwarded-SSL` variable and so cannot determine whether `RewriteCond %{HTTP:X-Forwarded-SSL}` is ON or OFF and thus give up. Thanks a lot for your help!
-
Hi @MajorLancelot I apologize for my delay in response to you. I was able to replicate this behavior and I subsequently opened an internal case on the matter CPANEL-22603 The only workaround I've found at this time is exactly what you noted as well - comment out the X-Forwarded-SSL line in the .htaccess. I'll update this thread when there's more information on the internal case and/or once the issue is resolved. Thanks! 0 -
Hi @MajorLancelot ... able to replicate this behavior
Thank you so much, Lauren! Really glad that you were able to validate our experience. Will be looking forward to a permanent fix.0 -
Hi @MajorLancelot You're most welcome, I'm looking forward to the same! I'll let you know any updates as soon as they're available. Thanks! 0 -
Just encountered this issue on v74.0.4. Aside from deleting the line manually, changing to "X-Forwarded-Proto: !https" as a conditition instead appears to work fine to take proxies into account. This is also the recommended syntax by Mozilla it appears. 0 -
Hi All, I'm updating this thread to let you all know that this issue is marked as resolved for v76 you can see the change in our ChangeLogs here: 76 Change Log - Change Logs - cPanel Documentation To resolve this issue please update to v76 - if you experience any issues whatsoever please let us know here! Thanks! 0
Please sign in to leave a comment.
Comments
5 comments