Hi,
this should be a quick one.
I’d like to shorten my URLs from mywebsite.com/projects/myproject-1
to mywebsite.com/myproject-1
. I understand that this should be possible using the inbuilt routing functionality https://getkirby.com/docs/guide/routing and think that I need this code in my config.php to catch the pattern:
return [
'routes' => [
[
'pattern' => '/projects',
'action' => function () {
// do something here
// when the URL matches the pattern above
}
]
]
];
But I can’t figure out how to actually reroute the URL in the “action” part of the code.
Would be glad about some help.
Thanks!