Fixes #5745: Gii and debug modules may cause 404 exception when the route contains dashes