spatie/laravel-missing-page-redirector

Easier way to redirect URLs where only the first parameter is broken

lasseeee opened this issue · 1 comments

Would it be possible to do something like the following, instead of having to explicitly type out every nested URI from a site where only the first URI parameter has changed:

Psudocode:

'/centers/oldcentername1/(?*}' => '/centers/newcentername1/{?*}'
'/centers/oldcentername2/{?*}' => '/centers/newcentername2/{?*}'
'/centers/oldcentername3/{?*}' => '/centers/newcentername3/{?*}'

So in other words: Store whatever comes after the broken parameter (paths, parameters, query strings, etc.), and append it after the fixed parameter.

You can put whatever logic you want in a custom redirector: https://github.com/spatie/laravel-missing-page-redirector#creating-your-own-redirector