To exclude a page when a specific key in the query string appears, you have to use JSON. For example, if you would like to exclude a page only if a sort argument appears in your filter variable, you would type:
{ "filter":{ "sort":"" } }
When your query looks like this ?filter[sort]=firstname, the page would be excluded because sort appeared.