Hy all .
I have some user defined routes stored in database to do some redirects .
example user/register (database stored) redirect to register (app defined route )
My thoughts of the day were to inject into Config\Routes or Events::on('pre_system'
$routes->addRedirect('user/fff', '/register'); //ErrorException Undefined offset: 1 SYSTEMPATH/Router\Router.php at line 472 $routes->addRedirect('user/fff', 'register' ); //ErrorException strpos() expects parameter 1 to be string, array given $routes->addRedirect('user/fff', 'Register::index'); // not working SYSTEMPATH/Router\Router.php : 483 throw RedirectException::forUnableToRedirect($val, $this->collection->getRedirectCode($key));
but seems that Config\Routes is called twice and throw error when adding the redirect
How to inject new routes redirection and where ? Before declaring route ? after ?