Introduction
When using an Apache include to redirect a site's traffic, additional customization is required to enable AutoSSL's DCV checks to succeed. The following procedure adds a redirect exclusion for AutoSSL to the Apache include file.
Procedure
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Open the site's include file in your preferred text editor.
-
Add the following lines to the top of the file.
<IfModule mod_rewrite.c> RewriteEngine On # Global DCV Exclude - Rewrites RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/.+$ [OR] RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$ [OR] RewriteCond %{REQUEST_URI} ^/\.well-known/pki-validation/(?:\ Ballot169)? [OR] RewriteCond %{REQUEST_URI} ^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$ [OR] RewriteCond %{REQUEST_URI} ^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Sectigo\ DCV)?$ # Exclude proxy subdomains as we need rewrites to capture the DCV requests RewriteCond %{HTTP_HOST} !^(?:autoconfig|autodiscover|cpanel|cpcalendars|cpcontacts|webdisk|webmail|whm)\. RewriteRule ^ - [END] </IfModule> - Save the changes and exit the file.
-
Rebuild the Apache configuration.
/usr/local/cpanel/scripts/rebuildhttpdconf
-
Restart Apache.
/usr/local/cpanel/scripts/restartsrv_httpd
Additional resources
How to use Apache includes to add configuration directives to a specific domain's virtualhost
Where would I add customizations to Apache?
Comments
0 comments
Article is closed for comments.