1
取而代之的有:Yii2改变URL结构
http://www.example.com/affiliate?ref=123456546546
我更喜欢有
http://www.example.com/affiliate/ref/123456546546
是否有可能通过GET PARAM不改变.htaccess
守我所期望的结构?
取而代之的有:Yii2改变URL结构
http://www.example.com/affiliate?ref=123456546546
我更喜欢有
http://www.example.com/affiliate/ref/123456546546
是否有可能通过GET PARAM不改变.htaccess
守我所期望的结构?
尝试将规则添加到您的UrlManager我猜你的控制器是会员和你的行动index
'urlManager' => [
...
'rules' => [
'<controller:(affiliate)>/ref/<ref:\d+>' => '<controller>/index',
]
...
]
我想如果你设置自定义规则,你还必须添加以下,这样的默认网址仍加工。
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',