oaziz
oaziz

Reputation: 1372

How can I redirect to another entry script?

I have two entry scripts on my application, as specified here. How can I set the route to redirect /example.com/admin to example.com/backend.php

Thanks.

Upvotes: 1

Views: 101

Answers (1)

miku
miku

Reputation: 188194

Take a look at the documentation about URL management:

Without knowing the details of your setup, in your protected/config/main.php (if main.php is you application configuration file), you would need something along this:

// note: this is extracted from a project which uses 'friedly urls',
//       depending on your setup, YMMV
'urlManager'=>array(
    'urlFormat'=>'path',
    'showScriptName' => false,
    'rules'=>array(
        '<controller:\w+>/<id:\d+>'=>'<controller>/view',
        '/admin'=>'/backend',    // <-- define your custom routes/redirects here
    ),
),

Upvotes: 3

Related Questions