From the instructions:
absolute-path [ "?" query ]
whereby absolute-path (which will not contain ?) must start with / and might optionally be
followed by a ? followed by a query, which may not contain ".
Notice, the "?" is inside the [ optional clause ], so you may assume that it is not part of absolute-path.
Store at the address in query the query substring from request-target. If that substring is absent
(even if a ? is present), then query should be "",
You might try sending that request (hello.php?) to the staff's version of server using a browser or curl to see the expected result. There should be no special handling in indexes (or lookup).
BTW excellent strategy, understanding the goal before undertaking the work. Usually saves lots of time and heartache.