2016-07-15 17:42:01 3698次浏览 2条回答 0 悬赏 10 金钱

yii2 分页链接:yii.com?r=site/index&id=1&page=1

使用了url 美化后,怎么分页链接没变啊?

补充于 2016-07-15 17:54

components:

//url美化
'urlManager' => [
    'enablePrettyUrl' => true,
    'showScriptName' => false,
    'rules' => [
            '<controller:\w+><action:\w+>/<id:\d+>/<p:\d+>'=>'<controller>/<action>',
        ],
],

nginx:

location / {
    # Redirect everything that isn't a real file to index.php
    try_files $uri $uri/ /index.php?$args;
}
  • 回答于 2016-07-15 17:49 举报

    你要发你的代码上来看看,还有nginx.conf中url规则的设置

    1 条回复
    回复于 2016-07-15 17:55 回复

    已补充,谢谢

  • 回答于 2016-07-18 07:53 举报

    至少用page对应

    <controller:\w+><action:\w+>/<id:\d+>/<page:\d+>
    
您需要登录后才可以回答。登录 | 立即注册
zw1019
助理

zw1019

注册时间:2016-03-30
最后登录:2016-12-03
在线时长:9小时25分
  • 粉丝1
  • 金钱10
  • 威望0
  • 积分100

热门问题