Default controler and structure questions

Hi all,

I wanna know the best way to create this front-end/back-end site strucuture

mysite.com/home

mysite.com/news

mysite.com/contactus

mysite.com/backend/page/admin

the frontend is only a single controller (site)

the backend will have many controller but the page controller will manage all frontend page.

My main problem is how to hide the frond-end controller

call mysite.com/home instead of mysite.com/site/home

I know htaccess can do something like that, but my htaccess skill is missing.

thank you.

hi please take look this guide page

http://www.yiiframework.com/doc/guide/1.1/en/topics.url

if you dont get it just let me know i will assist you

copy the following in you htaccess


RewriteEngine on


# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d


# otherwise forward it to index.php

RewriteRule . index.php

in your main file under urlManger


'urlManager'=>array(

            'urlFormat'=>'path',

            'showScriptName'=>false // add this line


           // your routes here

        ),

and then you can set you routes