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