-
-
Save kongondo/79d359134547366eb3ed842e450b543e to your computer and use it in GitHub Desktop.
Revisions
-
mandrasch revised this gist
Apr 7, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,8 +10,8 @@ RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> # Fixed version, check also that HTTP:X-Forward-Proto is off (= http), redirect # found this via .ddev/apache/apache-site.conf -> https://gist.github.com/nurtext/b6ac07ac7d8c372bc8eb <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} !=on -
mandrasch revised this gist
Apr 7, 2022 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,11 +3,10 @@ # RewriteRule ^ - [L,R=404] # The general rule for redirecting HTTP to HTTPS: # --> Results in "Error too many redirects" in DDEV, because %{HTTPS} is always == off <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> -
mandrasch created this gist
Apr 7, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # Debug trick, uncomment to check values: # ErrorDocument 404 "Request: %{THE_REQUEST} Referrer: %{HTTP_REFERER}, Host: %{HTTP_HOST}, HTTPS: %{HTTPS}, HTTP:X-Forwarded-Proto: %{HTTP:X-Forwarded-Proto}" # RewriteRule ^ - [L,R=404] # The general rule for redirecting HTTP to HTTPS: # Results in "Error too many redirects" in DDEV, because %{HTTPS} is always == off <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> # Fixed version, check for HTTP:X-Forward-Proto, found this via # .ddev/apache/apache-site.conf -> https://gist.github.com/nurtext/b6ac07ac7d8c372bc8eb <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} !=on RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IFModule>