• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect rule in routes with multi-app setup

Hello, is it possible to redirect from routes to a specific URL? I have multi-app setup using single CI installation, a shared app and independent apps and I would like to make a redirect from one to another by calling specific "index.php" file fore that app.

So basically it would be full redirect and not only routing option to the controller. Of course, another option here is using filter to make redirect there. Just asking if it is possible to do in the router as well.

$routes->group('admin', function ($routes){
    $routes->addRedirect('/', 'specific.index.php'); // <- This doesn' work
    $routes->add('login', 'Login::index', ['namespace' => '\Admin\Controllers\Auth']);

Thank You in advance ^-^

Found solution at the end. Simply by passing to option 'hostname' = $_SERVER['HTTP_HOST']

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.