after adding the above line in .htaccess, still facing same error
[root@admin-server amna]# certbot certonly --webroot -w /www/A1/ -d A1.xxxx.com
401 Unauthorized
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for iiw.ibiidi.com
Using the webroot path /www/A1 for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. iiw.ibiidi.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://iiw.ibiidi.com/.well-known/acme-challenge/VVn8OgBTekd1KCa7eWBkIsAsRC3xWD3-2RF7jACV_ag: "Unauthorized</"
IMPORTANT NOTES:
The following errors were reported by the server:
Domain: A1.xxxx.com
401 Unauthorized
Type: unauthorized
Detail: Invalid response from
http://A1.xxxx.com/.well-known/acme-challenge/VVn8OgBTekd1KCa7eWBkIsAsRC3xWD3-2RF7jACV_ag:
"Unauthorized</"
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
My htaccess
RewriteEngine On
RewriteRule ^.well-known - [L]
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /usr/local/apache/.htpasswd
#AuthUserFile /www/A1/.htpasswd
Require valid-user
My vhost conf file
<VirtualHost *:80>
ServerAlias A1.xxxx.com
ServerName A1.xxxx.com
DocumentRoot /www/A1
ErrorLog /usr/local/apache/logs/A1/error.log
CustomLog /usr/local/apache/logs/A1/acces.log common<Directory /www/A1>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
Also i have create this path and can access it via browser
http://A1.xxxx.com/.well-known/acme-challenge/test.txt