Doesn’t work for me. If I don’t define ANY url-rule, don’t touch defaultController/defaultAction and request the index page with the urlmanager config posted (the single rule excluded of course), it says:
Well I want to have trailing slashes for seo-reasons. If I remove the suffix it works like expected, but then the urlmanager->createUrl() function doesn’t append a trailing slash anymore.
Why that? If I define the rule "" => "my/test" then I expect the rule to do what I want. The defaultController/defaultAction should only render if there is no matching "empty" url-rule or if there are no rules at all defined.
Sorry I don’t have one. Just expirience and habit. I think it’s the best way, everyone should make their own expirience though.
I’ve just noticed my fix doesn’t work anymore when requesting for example “/test/” instead of “/”. The combination of urlSuffix = “/” and useStrictParsing = true causes too much problems. I have disabled strictParsing now and everything works without my fix and without any problems.
I suggest the useStrictParsing and urlSuffix feature should be re-written or extended so it works like expected. For example the getPathInfo() function in CHttpRequest trims the first/last "/" from the returning path. That means we will never get a match here when strictParsing is enabled and urlSuffix is "/".