feat: add editable 301 redirects via dedicated panel page
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 21s
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 21s
- New "Redirections" page in panel (blueprint + content) with a structure field: old URL (text) → target page (pages field, auto-resolves URL) - error.php controller intercepts 404s, checks redirect map, fires go() 301 - Cache (file driver) invalidated on redirections page update or slug change - Removed catch-all route that was breaking Kirby multilingual routing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
91ac702f3c
commit
dbeca5e095
5 changed files with 81 additions and 3 deletions
|
|
@ -12,8 +12,23 @@ return [
|
|||
|
||||
'thumbs' => require __DIR__ . '/thumbs.php',
|
||||
|
||||
'cache' => [
|
||||
'redirects' => ['type' => 'file'],
|
||||
],
|
||||
|
||||
'hooks' => [
|
||||
'page.update:after' => function ($newPage) {
|
||||
if ($newPage->id() === 'redirections') {
|
||||
kirby()->cache('redirects')->remove('map');
|
||||
}
|
||||
},
|
||||
'page.changeSlug:after' => function () {
|
||||
kirby()->cache('redirects')->remove('map');
|
||||
},
|
||||
],
|
||||
|
||||
'routes' => [
|
||||
require(__DIR__ . '/routes/download-white-paper.php')
|
||||
require(__DIR__ . '/routes/download-white-paper.php'),
|
||||
],
|
||||
|
||||
'tobimori.seo' => [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue