Worker path matching and query params conundrum

I'm seeing a lot of issues related to this and no real solution.

The problem is very simple and common:

I need something like example.com/a as a trigger for my worker, including any query strings or hashes in the url.

Some solutions I see commonly given and what is wrong with them:

  1. use example.com/a*
    • this will match also other paths like example.com/about which is undesired
  2. use example.com/a/*
    • this will not match example.com/a and neither it will match any query strings, unless there is a trailing slash in the url
  3. I tried using example.com/a?* trigger but this one will throws an error "Route pattern should not have query parameters"
So can someone please help me and explain why is this such a problem for something that should be very common? Thanks.
Was this page helpful?