Welcome Guest, Not a member yet? Register   Sign In
index.php, system_folder variable and multisite installation on windows
#11

[eluser]developer10[/eluser]
OK folks, i'm still confused regarding whether or not there is a simple solution leading to multi-site functionality in CI

What i want to achieve is this:

- have several subdomains containing what normally "application" folder of CI contains
- my host lets me choose a directory for my subdomains, so i choose them to be like this:
public_html/subdomain
- i want the CI system folder to be in my root directory, of course
- i will have my domains redirected to http://sub1.mysite.com, the other one to http://sub2.mysite.com, etc.

For now, i left
Code:
$system_folder = "system";
unchanged, but for application, i did this:

Code:
$host = $_SERVER['HTTP_HOST'];

switch($host)
{
    case 'localhost':
        $app = 'tumac';
        break;
    case 'kupi.povoljno.ba':
        $app = 'kupi';
        break;
    default:
        $app = 'glavni';
        break;
}

    $application_folder = $app;

On localhost, i'm able to get "tumac" and "kupi" apps, but on my server (where those directories/apps serve as subdomain directories) i only get index.html from "kupi" directory shown.

I know i have to do something with the code at the bottom (that deals with defining certains things, among other, APPPATH) but do not know what.

Furthermore, i feel i might have 2 solutions without tweaking the above mentioned code.
1. set the directories for my subdomains as "application/sub1" and "application/sub2" instead of "sub1" and "sub2" in the root directory
CON for this: what if i move to some other server that wont let me keep this structure?

2. instead of making subdirectories, make simple directories for each subdomain, like this: "public_html/app1/" and "public_html/app2/" but in my CP app1 and app2 are not defined as subdomains.
CON for this: I would have to redirect my domains in this way: "http://mysite.com/app1" and "http://mysite.com/app2" - but i'm not sure if that is possible, at least for stealth redirection..

So, tweaking the code for APPPATH would be the best solution so please give your hints.
Thanks!
#12

[eluser]xadio[/eluser]
I would recommend copying your application directories and placing each one in the subdomain root. Then copy the index.php and modify each one. Since the index is now in the root of your application you will need to specify the system as '../system'. The application will be the current directory (or './application' depending on where you put the application).

I hope this makes sense if not check out this tree I've defined:

Code:
/
/system            <-- CI System
/application       <-- Main CI Application
/subdomain1        <-- Subdomain 1
    /application   <-- S1 CI Application
    /index.php     <-- S1 CI Index.php
/subdomain2        <-- Subdomain 2
    /application   <-- S2 CI Application
    /index.php     <-- S2 CI Index.php
... etc
#13

[eluser]developer10[/eluser]
[quote author="xadio" date="1283671900"]I would recommend copying your application directories and placing each one in the subdomain root. Then copy the index.php and modify each one. Since the index is now in the root of your application you will need to specify the system as '../system'. The application will be the current directory (or './application' depending on where you put the application).

I hope this makes sense if not check out this tree I've defined:

Code:
/
/system            <-- CI System
/application       <-- Main CI Application
/subdomain1        <-- Subdomain 1
    /application   <-- S1 CI Application
    /index.php     <-- S1 CI Index.php
/subdomain2        <-- Subdomain 2
    /application   <-- S2 CI Application
    /index.php     <-- S2 CI Index.php
... etc
[/quote]


EDIT: Neglect text below. I changed some code before and wasnt aware of it. Now everything seems to be OK and working.
Thanks!



Done that.
Now my Error Log shows this
Code:
[05-Sep-2010 12:08:13] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required '/kupiconfig/constants.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/povoljno/public_html/system/codeigniter/CodeIgniter.php on line 52

"kupi" is the name of subdirectory
In the index.php located in the sub, system is set as
Code:
$system_folder = "../system"
and application is set as
Code:
$application_folder = "./application";




Theme © iAndrew 2016 - Forum software by © MyBB