File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ # Docs - https://github.com/samdark/yii2-cookbook/blob/master/book/urls-variable-number-of-parameters.md
4+ return [
5+ // index rule for Canonical tag
6+ '' => 'site/index ' ,
7+ // Other
8+ 'p/<slug:\w+> ' => 'site/page ' ,
9+ // for Site controller
10+ // '<alias:\w+>' => 'site/<alias>',
11+ ];
Original file line number Diff line number Diff line change 55
66$ config = [
77 'id ' => 'simple ' ,
8+ 'name ' => 'Сайт ' ,
89 'basePath ' => dirname (__DIR__ ),
910 'language ' => 'ru-RU ' ,
1011 'bootstrap ' => ['log ' ],
7071 'urlManager ' => [
7172 'enablePrettyUrl ' => true ,
7273 'showScriptName ' => false ,
73- 'rules ' => [
74- // need for right canonical
75- '' => 'site/index ' ,
76- // for Site controller
77- '<alias:\w+> ' => ' site/<alias> ' ,
74+ 'suffix ' => ' / ' ,
75+ ' normalizer ' => [
76+ 'class ' => 'yii\web\UrlNormalizer ' ,
77+ ' collapseSlashes ' => true ,
78+ 'normalizeTrailingSlash ' => true ,
7879 ],
80+ 'rules ' => require 'routes.php ' ,
81+
7982 ],
8083
8184 ],
You can’t perform that action at this time.
0 commit comments