Try the following without the trailing
Note: Grav uses internally
/wir-%C3%BCber-uns as current url. Note it has not trailing
Btw. I suspect the
/wir-(.*)/, with the trailing
/, doesn’t work. Maybe a typo?
Why? Because the current Url retrieved by Grav (using
$uri->uri(false)) does not contain a trailing slash. The current url returned is
That means the regex:
preg_replace($pattern, $replace, $source_url) will fail with the following values:
$pattern = #^\/wir-(.*)\/# <--- with trailing slash (=your pattern transformed into PHP pattern)
$replace = '/wir-ueber-uns'
$source_url = /wir-%C3%BCber-uns <--- without trailing slash
The $pattern does not match $source_url.
See also code lines Pages.php:1069-1087