Installing Let’s Encrypt error http-01

When you try to install the Let’s Encrypt certificate, you may receive the following message:

Error occurred: Status: invalid, Detail:, Type: http-01

It is most often caused by all traffic being redirected from http to https and / or redirected to the index.php file in order to use simple, friendly URL links (not containing the characters “?”, “&”, “=” Etc. )

If there are RewriteCond and RewriteRule rules in the .htaccess file, try adding a rule:

RewriteCond% {REQUEST_URI}! ^ / \. Well-known / acme-challenge / [0-9a-zA-Z _-] + $

The rule above is responsible for redirecting to https or to the index.php file. An example configuration of a .htaccess file with additional rules already inserted may look like this:

#example 1 - redirect from http to https
RewriteCond% {HTTPS}! = On
RewriteCond% {REQUEST_URI}! ^ / \. Well-known / acme-challenge / [0-9a-zA-Z _-] + $
RewriteRule ^. * $ Https: //% {SERVER_NAME}% {REQUEST_URI} [R, L]
#example 2 - redirection to "friendly" links
RewriteCond% {REQUEST_URI}! ^ / Index \ .php
RewriteCond% {REQUEST_FILENAME}! -F
RewriteCond% {REQUEST_FILENAME}! -D
RewriteCond% {REQUEST_URI}! ^ / \. Well-known / acme-challenge / [0-9a-zA-Z _-] + $
RewriteRule. * Index.php [L]

You should also remember that the selected domain when installing Let’s Encrypt correctly points to our servers. When redirecting individual DNS records, remember about the www subdomain. and mail.

Aleksandra Grygiel
Latest posts by Aleksandra Grygiel (see all)

Leave a Reply