{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/9091","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/9091/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9091/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/9091/events","html_url":"https://github.com/yiisoft/yii2/issues/9091","id":94713254,"number":9091,"title":"Url caching has error","user":{"login":"genichyar","id":3851611,"avatar_url":"https://avatars.githubusercontent.com/u/3851611?v=3","gravatar_id":"","url":"https://api.github.com/users/genichyar","html_url":"https://github.com/genichyar","followers_url":"https://api.github.com/users/genichyar/followers","following_url":"https://api.github.com/users/genichyar/following{/other_user}","gists_url":"https://api.github.com/users/genichyar/gists{/gist_id}","starred_url":"https://api.github.com/users/genichyar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genichyar/subscriptions","organizations_url":"https://api.github.com/users/genichyar/orgs","repos_url":"https://api.github.com/users/genichyar/repos","events_url":"https://api.github.com/users/genichyar/events{/privacy}","received_events_url":"https://api.github.com/users/genichyar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:to%20be%20verified","name":"status:to be verified","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/13","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.6","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/13/labels","id":1000704,"number":13,"title":"2.0.6","description":"","creator":{"login":"qiangxue","id":993322,"avatar_url":"https://avatars.githubusercontent.com/u/993322?v=3","gravatar_id":"","url":"https://api.github.com/users/qiangxue","html_url":"https://github.com/qiangxue","followers_url":"https://api.github.com/users/qiangxue/followers","following_url":"https://api.github.com/users/qiangxue/following{/other_user}","gists_url":"https://api.github.com/users/qiangxue/gists{/gist_id}","starred_url":"https://api.github.com/users/qiangxue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiangxue/subscriptions","organizations_url":"https://api.github.com/users/qiangxue/orgs","repos_url":"https://api.github.com/users/qiangxue/repos","events_url":"https://api.github.com/users/qiangxue/events{/privacy}","received_events_url":"https://api.github.com/users/qiangxue/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":135,"state":"open","created_at":"2015-03-01T16:03:07Z","updated_at":"2015-07-28T07:32:33Z","due_on":"2015-07-25T22:00:00Z","closed_at":null},"comments":2,"created_at":"2015-07-13T12:46:57Z","updated_at":"2015-07-28T15:08:51Z","closed_at":null,"body":"If I use following url rules\r\n```php\r\n[\r\n    'pattern' => '',\r\n    'route' => 'paracms/structure/frontend/page/view',\r\n    'defaults' => ['slug' => 'index'],\r\n],\r\n'page/<slug>' => 'paracms/structure/frontend/page/view',\r\n```\r\nand then run code\r\n```php\r\necho Url::to('/paracms/structure/frontend/page/view', ['slug' => 'services']);\r\necho '<br>';\r\necho Url::to('/paracms/structure/frontend/page/view', ['slug' => 'index']);\r\n```\r\nI have got\r\n```\r\n/page/services/\r\n/page/index/\r\n```\r\nBut I expeсted\r\n```\r\n/page/services/\r\n/\r\n```\r\n\r\nThis problem rises due to https://github.com/yiisoft/yii2/commit/ebc089e6c26ba85642e5b32eaae017c6b637be79\r\n\r\nWhen I call ```Url::to('/paracms/structure/frontend/page/view', ['slug' => 'services']);``` rule № 2 was cached and then it was used when I call ```Url::to('/paracms/structure/frontend/page/view', ['slug' => 'index']);``` instead of rule № 1.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/125642257","html_url":"https://github.com/yiisoft/yii2/issues/9091#issuecomment-125642257","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/9091","id":125642257,"user":{"login":"genichyar","id":3851611,"avatar_url":"https://avatars.githubusercontent.com/u/3851611?v=3","gravatar_id":"","url":"https://api.github.com/users/genichyar","html_url":"https://github.com/genichyar","followers_url":"https://api.github.com/users/genichyar/followers","following_url":"https://api.github.com/users/genichyar/following{/other_user}","gists_url":"https://api.github.com/users/genichyar/gists{/gist_id}","starred_url":"https://api.github.com/users/genichyar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/genichyar/subscriptions","organizations_url":"https://api.github.com/users/genichyar/orgs","repos_url":"https://api.github.com/users/genichyar/repos","events_url":"https://api.github.com/users/genichyar/events{/privacy}","received_events_url":"https://api.github.com/users/genichyar/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T15:08:51Z","updated_at":"2015-07-28T15:08:51Z","body":"@klimov-paul, thank you!\r\n\r\nI use same regexp as temporary solution: `page/<slug:((?!index).)*>`. But it doesn't work properly if slug has word \"index\". For example: `index1`, `indexation`, etc.\r\n\r\n> It seems 'create URL cache' feature should be reverted (which whould be a pity) or made optional.\r\n\r\nI think 'create URL cache' was good idea. If there is no issue with this feature except my issue I propose to not revert this feature and add an ability to make inversed regexp in url.\r\n\r\nFor example:\r\n`page/<slug:!index>` — All except \"index\"\r\n`page/<slug:!(index|sitemap|contacts)>` — All except \"index\", \"sitemap\", \"contacts\""}}