Virtualmin & Let's Encrypt SSL and .htaccess www redirect

Hi, I have installed Let’s Encrypt SSL on my domain and I can install it when there is no redirect to www.domain.com in .htaccess, but when it is present in my .htaccess file, I can’t install or renew cert.
My .htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTP_HOST} ![0-9]$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

**Operating system:Centos 7.7

You have to not redirect for the .well-known directory.

How can I exclude it? My .htaccess file is in main directory.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.