Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
Regex in If condition in apache configuration (let's encrypt configuration for renewal certificate)

I am trying to make the certificate renewal work. I guess with the new version, let's encrypt will look on http://[mondomain]/.well-known/acme-challenge/....

So, in my apache configurations, on my virtual host of port 80, I wanted to put a regex which when the .well-known exists in the URI, I do not redirect my virtualhost https so that let's encrypt can make your challenge (I tested and my certificate is well renewed when I deleted all redirects).

I specify that the directory /var/www/html/.well-known/acme-challenge exists on the apache server and that my DNS is with DNS provider.

I don't understand why my regex is not working.

Can you help me please ?

Here is the apache configuration.

<VirtualHost *:80>

    ServerName [Domain]
    ServerAlias [DomainWWW]
    DocumentRoot /var/www/html
    #Alias "/.well-known/acme-challenge/" "/var/www/html/.well-known/acme-challenge/
    #RewriteEngine on
    #RewriteCond %{HTTPS} !on
    #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}



    <If "%{REQUEST_URI} !~ m#\.well-known\/acme-challenge\/.*m#">
       RewriteEngine on
       RewriteCond %{HTTPS} on
       RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    </If>



</VirtualHost>

Thank you in advance.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The regex was OK . I was able to renew certificate. That's good now ! :)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!