Welcome Guest, Not a member yet? Register   Sign In
multiple applications - shared assets + models etc
#1

[eluser]Future Webs[/eluser]
Hi folks,

I know this has bought up before but I couldnt find anything that gave me a clear answer to my situation.

I took a look here fpr starters which got me so far
http://ellislab.com/codeigniter/user-gui..._apps.html

Heres what I need to be able to do

Split my site into 3 sections and have two of them run from with physical folders.

One of the reasons for this is that we need to implement ccbill as a payment system and they manage the authentication by means of protecting a folder (members area) within the public dir.

Quote:1 - www.mysite.com - main site
2 - members.mysite.com - members only version of main site
3 - admin.mysite.com - admin area

or (same thing i guess)

Quote:1 - www.mysite.com - main site
2 - www.mysite.com/members/ - members only version of main site
3 - www.mysite.com/admin/ - admin area

I need to share my models, helpers, views and assets(css / images etc) for each file but use seperate controllers.

For now I have the site set up as follows

Quote:home/domain/00_system/

home/domain/public_html/assets/css
home/domain/public_html/assets/js
home/domain/public_html/assets/images
etc etc

home/domain/public_html/index.php - main site index
home/domain/public_html/members/index.php - members site index
home/domain/public_html/admin/index.php - admin site index

At the moment all index files have the path to the application dir within the system folder set.

This gives me the same site run from each location but I then loose the css and image locations etc

Now, I could just create folders within the application dir and duplicate all my models, helpers and then adjust the controllers for each ap

The problem is that I want to share the models, helpers and the assets etc. In fact the only things that would be unique to each ap would be the controllers.

Am i making life difficult for myself or missing something or both :-)
#2

[eluser]JoostV[/eluser]
How about adding two folders to the controllers folder? That is a nice and easy way to use a modular structure in your site while still being able to share all models, libraries, etc.

| - controllers
| - members
| - admin

Stick all controllers for the members section in the members folder. These controllers will then be accessible through www.mysite.com/members/
Stick all controllers for the admin section in the admin folder. These controllers will then be accessible through www.mysite.com/admin/
All the controllers that are located directly in the controllers folder will be accessible through www.mysite.com/

Is that what you are looking for?
#3

[eluser]Future Webs[/eluser]
Afraid not as I have to have an actual folder on the server so that i can use htpassword files to protect it.

In this instance Im not using an auth system as part of ci but using ccbill to manage the subscriptions and they manage things by protecting a members folder.

I did have it set up as you said but you cant use htpassword and anyone can access any area of the site
#4

[eluser]JoostV[/eluser]
OK, that won't do the trick then Wink
#5

[eluser]Natebot[/eluser]
OK if I understand correctly, the issue is you want to be able to access the web assets found in /home/domain/public_html/assets from members.mysite.com, whose DocumentRoot (web root) is located at /home/domain/public_html/members, which is normally impossible (because the assets directory, while inside the web root of www.mysite.com is outside the web root of members.mysite.com)

Since you are using Apache, you have a few options
http://httpd.apache.org/docs/2.0/urlmapping.html

My first thought would be trying an Alias directive in your httpd.conf file for your subdomains.




Theme © iAndrew 2016 - Forum software by © MyBB