Letsencrypt with htaccess
<p><strong>This is my current htaccess configuration of /frontend/web</strong></p>

<pre><code>RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME} [R,L]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
</code></pre>

<p><strong>I am trying to insert this:</strong></p>

<pre><code>RewriteCond %{REQUEST_URI} !^.well-known/acme-challenge/$
</code></pre>

<p>or</p>

<pre><code>RewriteCond %{REQUEST_URI} ! /\.well-known|^\.well-known
</code></pre>

<p>above </p>

<pre><code>RewriteRule ^.*$ https://%{SERVER_NAME} [R,L]
</code></pre>

<p>to create letsecnrypt certificate, but none of this is working.</p>

<p>Letsencrypt command to create certificate (debug coz Centos6):</p>

<pre><code>./letsencrypt-auto --debug certonly --webroot -w /var/www/html/example.com/frontend/web/ --email example@gmail.com --domains example.com
</code></pre>

<p><strong>letsencrypt error:</strong></p>

<pre><code>The following errors were reported by the server:

Domain: example.com
Type:   unauthorized
Detail: Invalid response from
http://example.com/.well-known/acme-challenge/%acme%
</code></pre>

<p>Link above leads me to the HTTPS version of the site protocol. If I remove a redirect to https, I get a message on the successful receipt of the certificate . conclusion : .well-known continues to be sent to the https , my settings did not work , what am I doing wrong?</p>