but It doest not work when the url is http://127…0.0.1/c1/view where view is the action name,the error from apache server says could not find url specified.
I guess the second url above is matched by the first rule, and does not propagate to the second rule. So how can I match the second url to the second rule while still preserve the first rule functionality? thanks for any help.
Next time look at which URL actually was requested and debug from there. I think it was “http://127.0.0.1/c1”. Because everything “’<controller:(c1|c2|c3|gii)>’ => ‘<controller>’,” ignores everything after the controller when the controller is c1, c2, c3 or gii.
in this case, your last proposal edit2(see below) will not work, since I need to dispatch the username to user/profile, and not to be interpreted as a controller id.
As to your other suggestion edit1(see below),it will only work when the url is http://127…0.0.1/c1/view , but won’ work when url is http://127…0.0.1/c1,
Every request that is not "host/c1…", "host/c2…", "host/c3…" or "host/gii…" will use the last rule. That means that there must not be usernames like "cX" and "gii".