Web Server Traffic Redirect for Domain Verification

My current system is:

· CentOS 6.6
· Drupal 7.43

· Our document root is /home/csales/public_html

· I have created the directories /home/csales/public_html/.well-known/acme-challenge

· I have edited the .htaccess in /home/csales/public_html with the following rewrite rules (the Rewrite Module is ON):

RewriteCond %{HTTP_HOST} ^.*$
RewriteCond %{REQUEST_URI} !^/[0-9]+…+.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?$
RewriteRule ^.well-known/acme-challenge$ “http://dcv.akamai.com/.well-known/acme-challenge/” [R=301,L]

· I have also attempted to use the actual key/token at end of the redirect, with no success.

My assumption is that Drupal is not processing the redirect correctly, which is why we see 404 errors, instead of 301. One thing that I can think of, is that Drupal will not allow access to a directory beginning with “.”. However, I do not see that referenced in my .htaccess anywhere.

You can always stop your web server and use the standalone option to generate a cert using certbots built in server

That regular expression and redirect are incorrect. They don't match any possible request. It should be something like:

RewriteRule "^/\.well-known/acme-challenge/(.*)$" "http://dcv.akamai.com/.well-known/acme-challenge/$1" [R=301,L]

(You host your files on http://dcv.akamai.com/?) (Edit: Never mind, i looked up what http://dcv.akamai.com/ is.)

Thank you so much mnordhoff, I'll try this out!

1 Like

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