Yii Framework Forum: urgent for frontend and backend structure access - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

urgent for frontend and backend structure access Rate Topic: -----

#1 User is offline   chaitsi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 21-November 11

Posted 21 August 2012 - 04:50 AM

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/

frontend/


common/


backend/


api


images/
storage/

protected/
components/
config

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

controllers/

frontend/


backend/


views/

frontend/


backend/


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/
SiteController.php

Frontend/SiteController.php

Backend/SiteController.php


views/
layouts/

Frontend/layouts

Backend/layouts



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
0

#2 User is offline   seb 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 240
  • Joined: 29-June 09

Posted 21 August 2012 - 06:46 AM

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.
0

#3 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 493
  • Joined: 08-August 09

Posted 22 August 2012 - 12:14 AM

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

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users