r/linuxadmin • • Feb 04 '26

Access control by query parameter's value?

/r/apache/comments/1qvp1yc/access_control_by_query_parameters_value/
0 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/michaelpaoli Feb 04 '26

Easy peasy, use those environment variables that Apache provides, and then return whatever, e.g. 200 and some content, or some other response indicating prohibited or the like. Typically your basic CGI stuff - been around dang near forever, still highly functional and useful.

Let's see ... yeah, you've got, notably, QUERY_STRING and REMOTE_ADDR. If you want Apache to restrict by client IPs before even getting that far, you can do that.

2

u/ralfD- Feb 04 '26

Thank's but please read my question. This is not about how to restrict access in an application/CGi, it's about limiting IP based access control within Apache to URLs that have a given value for a specific parameter. /u/Marelle01 has given a working solution.

1

u/michaelpaoli Feb 05 '26

Sure, that works too.