Hi there!
I'd like to group some routes not starting with a certain word/segment (like "admin").
To do so I defined in the Config/Routes.php a group like
$routes->group('(?!admin)', function($routes) {
// routes defined here
});
but this only works out if I change in the system/Router/Router.php the line 419
if (preg_match('#^' . $routeKey . '$#u', $uri, $matches)) {
into
if (preg_match('#^' . $routeKey . '$#u', '/' . $uri, $matches)) {
Why is that?
I got that workaround from "https://www.phpliveregex.com/" as it turnes out that there are no matches for a certain route without the starting "/":
The pattern "^(?!admin)/index" will find matches against "/index" but not against "index"