[BlueOnyx:21252] Re: problem creation of let's encrypt certificate when using .htaccess

Michael Stauber mstauber at blueonyx.it
Tue Aug 15 13:28:25 -05 2017


Hi Pesja,

> ====
> 
> RewriteEngine On
> RewriteCond %{SERVER_PORT} 80
> RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R,L]
> 
> ===
Yeah, that won't do. Let's Encrypt does an online verification. It puts
a file into a special folder in your web tree and then tries to access
that file via all the domains that your cert should be valid for. If you
have RewriteRules that prevent this, then the verification fails.

You need to insert this RewriteRule to allow LE access to the
.well-known directory:

RewriteRule ^(?!\.well-known(?:$|/)).* https://%{SERVER_NAME}/$0 [R=301,L]

Examples:

https://stackoverflow.com/questions/38790421/letsencrypt-with-htaccess

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list