Yii2 框架如何将 www.test.com/product.html?id=5252 这样的 配置成www.test.com/product-5252.html
可以尝试在配置文件里设置类似以下这种形式
<?php
return [
...
'components' => [
...
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => true,
'suffix' => '.html',
'rules' => [
'product-<id:\d+>' => 'product/view',
],
],
],
...
];