Hello ![]()
I have a problem with rerouting on a multilanguage page:
I have this url:
https://nameofwebsite.de/de/studies/studies/nameofcourse/overview
and want it to be like this:
https://nameofwebsite.de/de/studies/nameofcourse/overview
so get rid of the double studies/studies and reduce it to studies/
I checked the docs and found out how to remove the parent slug.
But somehow I can not get it to work:
[
'pattern' => '(:any)/studies/(:all)',
'language' => '*',
'action' => function($lang, $uid) {
$page = page($uid);
if (!$page) {
$page = page('studies/' . $uid);
}
if (!$page) {
$page = site()->errorPage();
}
return site()->visit($page);
}
],
[
'pattern' => 'studies/(:all)',
'language' => '*',
'action' => function($uid) {
go($uid);
}
]
Am I missing something?
Thank you already