Generating Url for a route
What you can do is to define the path as a non-routed path:

&lt;?
$url = Url::fromUri('base://knowledge-base');


(The base:// stuff is a bit weird IMHO, don't ask me why it's named like that. @dawehner might know ;))

This has a few limitations, some methods will then not work (like getRouteName()), and the url will not be checked for access.

The only other way I can think of is to define two displays in your view, one without an argument and the other one that requires it.