在配置文件里修改:

yii2.0 路由美化以及自定义设置

如果把'enablePrettyUrl' => true,设为true那么你的gii就访问不到;

'rules' => [
                 '<controller:\w+>-<action:\w+>'=>'<controller>/<action>',
            ],

这里就是url自定义,controller/action 这里可以自定义:

http://www.xxxxxx/login/index修改前

http://www.xxxxxx/login-index修改后

相关文章:

  • 2021-12-01
  • 2021-10-20
  • 2021-08-12
  • 2021-07-20
  • 2022-01-07
  • 2019-12-24
  • 2022-12-23
  • 2022-02-09
猜你喜欢
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2021-06-27
相关资源
相似解决方案