Welcome Guest, Not a member yet? Register   Sign In
Redirect rule in routes with multi-app setup

(This post was last modified: 10-13-2019, 06:46 AM by JoellSVK.)

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']

Theme © iAndrew 2016 - Forum software by © MyBB