I actually have a simple alias solution, please let me know if it works for you:
basically replace your Pages.php dispatch() function with this one:
public function dispatch($url, $all = false)
{
// Fetch page if there's a defined route to it.
$page = isset($this->routes[$url]) ? $this->get($this->routes[$url]) : null;
// If the page cannot be reached, look into site wide routes.
if (!$all && (!$page || !$page->routable())) {
/** @var Config $config */
$config = $this->grav['config'];
if ($route = $config->get("site.routes.{$url}")) {
$page = $this->dispatch($route, $all);
} else {
// Try looking for wildcards
foreach ($config->get("site.routes") as $alias => $route) {
$match = rtrim($alias, '*');
if (strpos($alias, '*') !== false && strpos($url, $match) !== false) {
$wildcard_url = str_replace('*', str_replace($match, '', $url), $route);
$page = isset($this->routes[$wildcard_url]) ? $this->get($this->routes[$wildcard_url]) : null;
if ($page) {
return $page;
}
}
}
}
}
return $page;
}
Then you can use aliases like this in your site.yaml:
routes:
/something/else: /blog/sample-32
/another/one/here: /blog/sample-3
/*: /blog/*
/another/*: /blog/*
it's not sophisticated routing but does provide some simple wildcard capabilities without too much overhead.
if the page is not found, it tries the wildcard routes looping over each in turn trying to find a page that exists. It will obviously match the first option that is successful.