CodeIgniter Forums

Full Version: Redirect rule in routes with multi-app setup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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']