fatnjazzy
fatnjazzy

Reputation: 6152

CodeIgniter, newbie questions

I want to program in the CodeIgniter few domain and 2 admins under a linux machine.

one.com two.com three.com ....com

and in addition to i need two backend systems.

reports cms

only few things are similar between the domains. and can be shared what is the best folder structures for that?

after you suggest your structure, how do i do it in the router and in the index.php. i read some articles but none of them explain it so it can be doable for a newbie.

thanks

Upvotes: 0

Views: 255

Answers (4)

Yada
Yada

Reputation: 31225

This is what you need to do:

  1. Move the "system" folder up one directory.

    old folder structure: www\codeignitor\application\system to: www\codeignitor\system

  2. Change the $system_folder in the index.php = "system"; variable in index.php to point one level up.

Doing this allows you to share the system folder and you can have many application folders.

In config.php

    $system_folder = "system";
    To:
    $system_folder = "../system";

For extra security you may rename the system folder to something else people can't guess or move the system folder two levels up to your home directory.

Upvotes: 0

mtvee
mtvee

Reputation: 1565

/var/www-virtual
    | -- /system  
    |    |-- /cache
    |    |-- ...
    |
    | -- /apps
    |     | -- /one.com
    |     |    | -- /config
    |     |    | -- /controllers
    |     |    | -- ...
    |     | -- /two.com
    |     |    | -- /config
    |     |    | -- /controllers
    |     |    | -- ...
    |
    | -- /public    
    |    | -- /one.com
    |    |    | -- /index.php
    |    |    | -- /css
    |    |    | -- ...
    |    | -- /two.com
    |    |    | -- /index.php
    |    |    | -- /css
    |    |    | -- ...

This is how I rig it. Each virtual host points at /var/www-virtual/public/??.com and in each /var/www-virtual/public/??.com/index.php I have...

$system_folder = "../../system";
$application_folder = "../../apps/??.com";

Hope that makes sense.

Upvotes: 3

musoNic80
musoNic80

Reputation: 3692

I would also recommend using a different installation of Codeigniter for each domain. However, if you do want to use just one installtion for different applications then the user guide explains how here:
Managing your applications: CodeIgniter User Guide

Upvotes: 0

Pedro
Pedro

Reputation: 2927

If there is just few things in common why you don't install one instance of Codeigniter for each domain?

But if you want to have just one Codeigniter instance, so I recomend that you create one main controller per domain (controller_domain1,...,controller_domainX), and separate the views in subfolders like (domain1,domain2,domain3).

Regards,
Pedro

Upvotes: 0

Related Questions