{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/7670","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/7670/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/7670/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/7670/events","html_url":"https://github.com/yiisoft/yii2/issues/7670","id":60670027,"number":7670,"title":"UrlRule Problem with trailing slash (/)","user":{"login":"Bhoft","id":1777147,"avatar_url":"https://avatars.githubusercontent.com/u/1777147?v=3","gravatar_id":"","url":"https://api.github.com/users/Bhoft","html_url":"https://github.com/Bhoft","followers_url":"https://api.github.com/users/Bhoft/followers","following_url":"https://api.github.com/users/Bhoft/following{/other_user}","gists_url":"https://api.github.com/users/Bhoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Bhoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bhoft/subscriptions","organizations_url":"https://api.github.com/users/Bhoft/orgs","repos_url":"https://api.github.com/users/Bhoft/repos","events_url":"https://api.github.com/users/Bhoft/events{/privacy}","received_events_url":"https://api.github.com/users/Bhoft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:under%20discussion","name":"status:under discussion","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/6","html_url":"https://github.com/yiisoft/yii2/milestones/2.1.x","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/6/labels","id":458001,"number":6,"title":"2.1.x","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":97,"closed_issues":0,"state":"open","created_at":"2013-10-17T21:06:09Z","updated_at":"2015-06-08T08:53:54Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-03-11T14:49:39Z","updated_at":"2015-06-15T13:44:08Z","closed_at":null,"body":"Hi i have added a UrlManager rules like given below added to my config\r\n```\r\n  '<project:[-a-zA-Z]+>/<controller:\\w+>' => '<controller>',\r\n  '<project:[-a-zA-Z]+>/<controller:\\w+>/<action:\\w+>' => '<controller>/<action>',\r\n```\r\n\r\nIf i then call a url like \r\n```\r\n/projectname/controllername/action            (works)\r\n/projectname/controllername           (works pointing to the default action in the controller)\r\n\r\n/projectname/controllername/              (with trailing slash doens't work)\r\n```\r\nBut the Url with a trailing slash produces a 404 error on the SiteController.\r\n\r\nThis is because the UrlRule doesn't match.\r\nif i change the UrlRule to the code below (\\w* instead of \\w+) the default controller action is called.\r\n```\r\n  '<project:[-a-zA-Z]+>/<controller:\\w+>/<action:\\w*>' => '<controller>/<action>',\r\n```\r\nI also tested the UrlRules in yii1 but there the UrlRules from the top are also working with a trailing / in the Url but not in yii2.\r\n\r\nSo I guess there is some kind of \"bug\". \r\nI Don't Know if the trailing slashes are removed in the Request in yii1 but not in yii2.\r\nBut there is clearly some difference between the 2 frameworks.\r\n\r\nRegards Horizons"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/112075663","html_url":"https://github.com/yiisoft/yii2/issues/7670#issuecomment-112075663","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/7670","id":112075663,"user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T13:44:08Z","updated_at":"2015-06-15T13:44:08Z","body":"It seems to a bigger problem than I've thought. Wordpress is adding `/` at the end of all links posted."}}