Customize url

hi, this is my first post and iam a newbie,

Iam developing a yii app, i work like to customize my url like

example.com/site/mypages/page1 ==> example.com/page1.

And my file structure is like,

protected -> views -> site -> mypages -> pages

and i use site controller for my mypages folder also

thanks in advances

set rules in Url Manager in config like this -


'urlManager'=>array(

    'urlFormat'=>'path',

    'showScriptName'=>false,

    'rules'=>array(

        'page1'=> 'site/mypages/page1',

    )

)