0

I need to be able to access user profiles via www.website.com/username. I have no idea how to write a rule for the rule manager to work this way. I would have a UserProfile controller to which i would like the first parameter of the url to be redirected to. Is there a way to say to the router that if he doesn't find a controller by the requested name, to execute the UserProfile controller with the rest of the parameters?

here's my current settings:

'urlManager'=>array(
        'urlFormat'=>'path',
        'showScriptName'=>false,
        'rules'=>array(
            'login' => 'site/login',
            'signup/confirm/<code>' => 'signup/confrim'
        ),
    ),
Keeper Hood
  • 594
  • 5
  • 17

1 Answers1

0

try this. i assume you have profile controller with name UserProfileController.php

'<username:\w+>'=> 'userProfile/view' 
Shiv
  • 1,269
  • 11
  • 20