This is usually fine if you’re using rewrites
rather than redirects
- redirect rules send all the URLs to the new location, whereas rewrites parse the URL and send it off elsewhere, which is the same for the browser, but allows more control, and can be overridden at different levels, which is what Sympl has configured for the typical .well-known
directory.
Rather than a basic redirect, like…
Redirect / https://target.example.com
You can use a rewrite more like:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/\.well-known/
RewriteRule (.*) https://target.example.com$1 [R,L]
Which will redirect any URL where the path doesn’t start with /.well-known/
to the target, allowing LE certs to be renewed as normal.
Sympl includes some handlers to do some of this automatically so in some cases you may not need the RewriteCond
, but the above should work in all cases.