We use additional apache directives (not .htaccess!!) to force clients to be redirected to SSL.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST} [R,QSA]
</IfModule>
This works without a problem. We installed the let's encrypt plugin and all was fine until we got a message the certificate was not renewed. I tried a manual renewal and got the following error (plesk team, the html is escaped, needs a fix):
Error: Let's Encrypt SSL certificate installation failed: Failed letsencrypt execution: Failed authorization procedure. <domain> (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://<domain>/.well-known/acme-challenge/<large code>: "<html>
So it seems that let's encrypt requests a response from an unencrypted url (?, why not use HTTPS and just ignore certificate errors?) and that can't be reached because it will be rewritten to an https url according to our mod_rewrite rules.
So what's to do next: make a rule the excludes the request url from the mod_rewrite. Ive tried all options I could think but but somehow my rule for exluding isn't matched, could be the . at the beginning of the url? I've tried these rules among others:
== variants using a match and stopping rule processing ==
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/\.well\-known/.*$ - [L]
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^\.well\-known/.*$ - [L]
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/\.well-known/.*$ - [L]
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^\.well-known/.*$ - [L]
....
== variants using not-match for ssl redirecting to take place ==
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !/.well-known/
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !/\.well\-known/acme-challenge/
....
Nothing seems to work? Somehow I can't get a match for the requested url... Please help without telling me to use .htaccess or code it in php... I want to know why it isn't working in plesk additional directives.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !/.well-known/acme-challenge/
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST} [R,QSA]
</IfModule>
This works without a problem. We installed the let's encrypt plugin and all was fine until we got a message the certificate was not renewed. I tried a manual renewal and got the following error (plesk team, the html is escaped, needs a fix):
Error: Let's Encrypt SSL certificate installation failed: Failed letsencrypt execution: Failed authorization procedure. <domain> (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://<domain>/.well-known/acme-challenge/<large code>: "<html>
So it seems that let's encrypt requests a response from an unencrypted url (?, why not use HTTPS and just ignore certificate errors?) and that can't be reached because it will be rewritten to an https url according to our mod_rewrite rules.
So what's to do next: make a rule the excludes the request url from the mod_rewrite. Ive tried all options I could think but but somehow my rule for exluding isn't matched, could be the . at the beginning of the url? I've tried these rules among others:
== variants using a match and stopping rule processing ==
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/\.well\-known/.*$ - [L]
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^\.well\-known/.*$ - [L]
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/\.well-known/.*$ - [L]
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^\.well-known/.*$ - [L]
....
== variants using not-match for ssl redirecting to take place ==
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !/.well-known/
....
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !/\.well\-known/acme-challenge/
....
Nothing seems to work? Somehow I can't get a match for the requested url... Please help without telling me to use .htaccess or code it in php... I want to know why it isn't working in plesk additional directives.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !/.well-known/acme-challenge/
....