使用子弹时如何在Yii2中禁止网址

时间:2019-01-07 18:55:30

标签: yii2

我的urlManager配置如下:

'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                '<lang>/<p_page>/<p_category>/<p_product>' => 'splitter/manage-request',
                '<lang>/<p_page>/<p_category>' => 'splitter/manage-request',
                '<lang>/<p_page>' => 'splitter/manage-request',
                '<lang>/' => 'splitter/manage-request',
                '<lang>' => 'splitter/manage-request',
                '' => 'splitter/manage-request',
            ],
        ],

例如,我的网址看起来像www.example.com/bg/page-44/product-22。所有请求的url都将通过此SpliiterController/actionManageRequest,从而构造另一个url-www.example.com/bg/page-44/product-22并执行适当的视图(例如PageController/actionProduct)。如何disallow这样的页面?如果我有两种语言的购物车网址,例如../bg/количка-22../en/cart-22

Disallow: /bg/количка-22
Disallow: /en/cart-22

是正确的方法吗?谢谢!

0 个答案:

没有答案