Commit 6c9b9408 authored by helmo's avatar helmo Committed by helmo

Issue #2952366 by helmo, antoine.guichard, memtkmcc: Exclude...

Issue #2952366 by helmo, antoine.guichard, memtkmcc: Exclude /.well-known/acme-challenge from "HTTPS Required"
parent 936ec101
...@@ -42,10 +42,14 @@ if ($this->redirection || $ssl_redirection) { ...@@ -42,10 +42,14 @@ if ($this->redirection || $ssl_redirection) {
if ($ssl_redirection && !$this->redirection) { if ($ssl_redirection && !$this->redirection) {
print " # Redirect aliases in non-ssl to the same alias on ssl.\n"; print " # Redirect aliases in non-ssl to the same alias on ssl.\n";
print " # Except for /.well-known/acme-challenge/ to prevent potential problems with Let's Encrypt\n";
print " RewriteCond %{REQUEST_URI} '!/.well-known/acme-challenge/'\n";
print " RewriteRule ^/*(.*)$ https://%{HTTP_HOST}/$1 [NE,L,R=301]\n"; print " RewriteRule ^/*(.*)$ https://%{HTTP_HOST}/$1 [NE,L,R=301]\n";
} }
elseif ($ssl_redirection && $this->redirection) { elseif ($ssl_redirection && $this->redirection) {
print " # Redirect all aliases + main uri to the selected alias https uri.\n"; print " # Redirect all aliases + main uri to the selected alias https uri.\n";
print " # Except for /.well-known/acme-challenge/ to prevent potential problems with Let's Encrypt\n";
print " RewriteCond %{REQUEST_URI} '!/.well-known/acme-challenge/'\n";
print " RewriteRule ^/*(.*)$ https://{$this->redirection}/$1 [NE,L,R=301]\n"; print " RewriteRule ^/*(.*)$ https://{$this->redirection}/$1 [NE,L,R=301]\n";
} }
elseif (!$ssl_redirection && $this->redirection) { elseif (!$ssl_redirection && $this->redirection) {
......
...@@ -15,6 +15,11 @@ ...@@ -15,6 +15,11 @@
?> ?>
RewriteEngine on RewriteEngine on
# Redirect ALL visitors to a configured url.
# Except for /.well-known/acme-challenge/ to prevent potential problems with Let's Encrypt
RewriteCond %{REQUEST_URI} '!/.well-known/acme-challenge/'\n";
# the ? at the end is to remove any query string in the original url # the ? at the end is to remove any query string in the original url
RewriteRule ^(.*)$ <?php print $this->platform->server->web_disable_url . '/' . $this->uri ?>? RewriteRule ^(.*)$ <?php print $this->platform->server->web_disable_url . '/' . $this->uri ?>?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment