I need to work with some user-agents in Apache 2.4. I googled a lot for examples, tried a million regex options, and it still doesn't work:
<If "%{HTTP_USER_AGENT} == '/^.*(Google|bing|Windows|Gecko).*$/'">
Require all granted
</If>
Meanwhile, RegExp as such works fine (see https://regexr.com/7lar4 ). And it clearly points to my wrong homebrew Apache syntax.
This is what I already tried as well:
<If "%{HTTP_USER_AGENT} == '^.*(Google|bing|Windows|Gecko).*$'">
Require all granted
</If>
<If "%{HTTP_USER_AGENT} == '~/^.*(Google|bing|Windows|Gecko).*$/'">
Require all granted
</If>
And so on. Nothing worked.
Please advise!