The main problem with your configuration is that the REQUEST_URI variable contains everything after and after the slash. The third RewriteCond statement should be updated something like this:
RewriteCond %{REQUEST_URI} !^/da/gateway_callback/.*$ [NC]
This should be consistent with the example you provided. If the URI does not always start with /da/ , you may need to add a wildcard:
RewriteCond %{REQUEST_URI} !^/[^/]+/gateway_callback/.*$ [NC]
where [^/]+ matches one or more characters that are not a slash.
I would recommend always using regex anchors wherever possible, since it eliminates ambiguity. The original RewriteCond trying to match REQUEST_URI does not use them, which may confuse administrators with a casual look.
Also note that all related examples for the RewriteCond and RewriteRule in the official documentation
source share