keeg
keeg

Reputation: 3978

change url for modules in Yii2

Is there an easy way to change the default url for a module? I have created an Admin module but I don't want it to reside at /admin as that is easy to guess and I'd like to host it at a more obscure path like /c3ntgu33sthis but don't want to create a module called c3ntgu33sthis, plus I'd like to change the url once in a while.

Upvotes: 0

Views: 148

Answers (1)

Bizley
Bizley

Reputation: 18021

When configuring your module you can set any name for it you like and change it later on.

I assume you have got something like:

'modules' => [
    // ...
    'admin' => [
        'class' => 'module\namespace\for\Admin'
    ],
],

Change it to:

'modules' => [
    // ...
    'c3ntgu33sthis' => [
        'class' => 'module\namespace\for\Admin'
    ],
],

Upvotes: 1

Related Questions