My comment was turning into an answer. So, here you go.
Next time, please make sure to follow the How to Ask.
Please, have a read of the ZF3 docs on Router and possibly RFC 3986 Chapter 3 - Syntax Components which shows what is path and what is query.
From RFC 3986 Chapter 3 - Syntax Components
The following are two example URIs and their component parts:
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
| _____________________|__
/ \ / \
urn:example:animal:ferret:nose
ZF3 route configuration is typically configuration on a path. (This is also true of pretty much every common framework.) Yes, variables can be part of a path. As such, they're configured in route configuration. Advanced configuration of framework routing often also allows for changes/requirements in schemes and authorities.
Not part of routing configurations are the 'query' and 'fragment' parts.
If you want to do something, e.g. catch a "name" key/value pair and do routing accordingly, you're going to have to create a "catcher" (or whatever the name for that would be) on the path and determine the redirection yourself.
For example, you could do something like this answer. If your controller instance extends the default Zend Framework AbstractActionController
class, then you should have the forward
plugin available. From the docs:
Forward returns the results of dispatching the requested controller;
it is up to the developer to determine what, if anything, to do with
those results. One recommendation is to aggregate them in any return
value from the invoking controller.
As an example:
$foo = $this->forward()->dispatch('foo', ['action' => 'process']);
return [
'somekey' => $somevalue,
'foo' => $foo,
];
Of course, you could immediately return it.
Another option is the redirect
plugin (same link).
return $this->redirect()->toRoute('login-success');
With all this you can do something like:
$name = $this->params()->fromQuery('name', null);
if ($name) {
// dispatch
if ($dispatchResult) {
// return special
}
}
// redirect
Where you redirect to a route name (ie. configured path)