all. I have a syntax problem. I've tried following other sources, but It's just not working.
I've successfully created an unconditional HTTP to HTTPS redirect. Go to http://www.robjvargas.com, wind up at HTTPS. All well and good there.
But now my certificate seems to need HTTP. It's using Let's Encrypt, and so needs renewal every 90 days. With the redirect in effect, a dry-run fails. With the redirect off, the dry run succeeds.
So I tried to put a RewriteCond in to exempt the cert renewal traffic:
# HTTP to HTTPS redirect
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{Request_URI} !^./acme-challenge/*
RewriteRule (.*) https://www.robjvargas.com$1 [R,L]
Only it doesn't work. I think I'm missing something worthy of a forehead slap once I see it, but I'm not seeing it. With the code above, the HTTP to HTTPS redirect still seems universal. So, clearly, the RewriteCond is incorrect. The period before the URI is probably wrong, but I've tried both with and without that.
I also put the full URI into the RewriteCond, but that didn't exempt it, either.
I'm close. I don't get any errors. It just never meets the intended condition.
What am I missing?