One adjustment includes the “?” just before “.*” at the end of the string.
As for escapes, they still don’t show on screen so add a backslash before “.well” and before “-known”.
The RewriteCond above basically ONLY run the RewriteRule when the URI does NOT include “.well-known” in it.
*** professional Linux assistance at: https://tpnassist.com ***