In my apache config, I want to allow access only when a specific url parameter matches a specific cookie.
I imagine a solution looking similar to this (in pseudocode):
param = get_url_parameter_with_a_specific_name_from_request
if (!http_cookie_includes_a_cookie_named_<param>) {
Require all denied
}
How can I implement that?
<If "%{QUERY_STRING} =~ /myparam=abc/>
<If "${HTTP_COOKIE} =~ /abc=1/">
Require all granted
</If>
<Else>
Require all denied
</Else>
</If>
<Elseif "%{QUERY_STRING} =~ /myparam=def/>
<If "${HTTP_COOKIE} =~ /def=1/">
Require all granted
</If>
<Else>
Require all denied
</Else>
</Elseif>
<Elseif "%{QUERY_STRING} =~ /myparam=ghi/>
<If "${HTTP_COOKIE} =~ /ghi=1/">
Require all granted
</If>
<Else>
Require all denied
</Else>
</Elseif>
<Elseif "%{QUERY_STRING} =~ /myparam=whatever/>
<If "${HTTP_COOKIE} =~ /whatever=1/">
Require all granted
</If>
<Else>
Require all denied
</Else>
</Elseif>
...
How can I write this without mentioning the whatever
part specificyally but using a variable instead?