[Solved]Enablehistory & Weird Urls In Module

Hi,

I’m getting weird URLs when browsing in a module and enableHistory is true. When browsing within main application, enableHistory is working perfectly.

[list=1][]admin is module[]product is controller[*]admin is action[/list]

// domain.com/admin/product/admin/undefined//ajax/product-grid/Product_page/9?undefined=

Someone else was having the same problem.

I have a nagging suspicion it’s got to do with URL rules. I’m posting mine here to see if anyone can spot anything.





                'shop/cart' => 'shop/cart',

                'shop/checkout' => 'shop/checkout',

                'shop/<controller:\w+>/<categorySlug:([a-z0-9]+-)*[a-z0-9]+>' => 'shop/<controller>/categoryIndex', // http://stackoverflow.com/questions/4168304/php-regular-expression-for-alphanumeric-and-hypen-input

                'shop/<controller:\w+>' => 'shop/<controller>/index', // http://stackoverflow.com/questions/4168304/php-regular-expression-for-alphanumeric-and-hypen-input

                'shop/<controller:\w+>/view/<productSlug:([a-z0-9]+-)*[a-z0-9]+>' => 'shop/<controller>/view',

                '<controller:\w+>/<id:\d+>' => '<controller>/view',

                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',



Thanks,

Matt

Aha! https://github.com/yiisoft/yii/issues/1246#issuecomment-7814152