urgent for frontend and backend structure access

I m beginner in yii

I have created one structure to handle files for frontend and backend so that common files can be used for both and different files form their folder


  framework/ (This folder will contain all yii framework core folders and files)          


   assets/


   js/





      [indent]frontend/[/indent]





      [indent]common/[/indent]





      [indent]backend/[/indent]





      [indent]api[/indent]





 images/


 storage/


      


 protected/


         components/


         config





             main.php   (DB, emails, etc...)





         controllers/





             [indent] frontend/[/indent]





             [indent] backend/[/indent]





         views/





               [indent] frontend/[/indent]





               [indent] backend/[/indent]





        models/       


        extensions/


        modules/  


        


        runtime/


        index.php


        .htaccess

this structure is created for booking application.

Some common files are shared between them it will be there in controller/ and views/

and differnrt file will be in controller/frontend/ and controller/backend/

Example

I have files in both folder as below

controller/

 [indent]SiteController.php[/indent]


 [indent]Frontend/SiteController.php[/indent]


 [indent]Backend/SiteController.php[/indent]

views/

[indent]layouts/[/indent]

[indent]Frontend/layouts[/indent]

[indent]Backend/layouts[/indent]

Now the question is how can i set .htaccess so that

when i write http://myapp.com/index.php --> will access all files for frontend

and

http://myapp.com/backend/inex.php --> will access backend files (beckend views and controller)

thanks in advance

You don’t have to configure it in the .htaccess in Yii such things usually done via UrlManager component configuration.

Here is a wiki article which describes similar approach, the structure is a bit different then yours, but maybe it is not too late to change it as described.

And this article describes structure that looks like yours.

In addition to what is said before.

With similar structure I usually access backend by http://domain.com/backend/site

If you need access to backend/index.php definitely you may redirect to your actual url, something like




 RewriteEngine on

RewriteBase /

RewriteRule backend/index.php backend/site [R,L]



Or better with mod_alias


Redirect /backend/index.php /backend/site