• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Sites - Using the wrong controller.

#1
[eluser]gp177[/eluser]
Hi everyone,

I have two sites. Inetdev and Inetpub. Both with a codeigniter framework. When I reference index.php/mycontroller/ on my dev site it uses the controller on the dev site. When I reference internal.php/mycontroller/ on my dev site it seems to use the controller on my inetpub site. My index.php file and internal.php file are exactly the same. For the life of me I can't figure out why the index.php site would work but not the internal.php.

I am running codeigniter on a Windows 2003 machine running IIS 6.0.

Thanks for your help,
GP

#2
[eluser]jrlooney[/eluser]
just based on what you have posted, I could see that happening because you are calling the same controller. You could put your sites in separate folders, then in your front controller you tell which folder to look in:

index.php change the line that assigns $application_folder. So something like

Code:
$application_folder = "public";

And put your public site into a folder called "public"

Then in internal.php:

Code:
$application_folder = "dev";

And put your dev site in a folder called "dev".

Here is a how to set up multiple applications in one instance of CI (I personally use method #2):

http://codeigniter.com/wiki/Multiple_Applications/


[quote author="gp177" date="1223579268"]Hi everyone,

I have two sites. Inetdev and Inetpub. Both with a codeigniter framework. When I reference index.php/mycontroller/ on my dev site it uses the controller on the dev site. When I reference internal.php/mycontroller/ on my dev site it seems to use the controller on my inetpub site. My index.php file and internal.php file are exactly the same. For the life of me I can't figure out why the index.php site would work but not the internal.php.

I am running codeigniter on a Windows 2003 machine running IIS 6.0.

Thanks for your help,
GP[/quote]

#3
[eluser]gp177[/eluser]
Thanks for the response (especially that link).

Currently my directory structure looks like this.

/inetpub/
/system/
/wwwroot/
index.php
internal.php
/inetdev/
/system/
/wwwroot/
index.php
internal.php

However if this doesn't work I will have to rethink our layout and maybe move to one of the suggested layouts.

#4
[eluser]jrlooney[/eluser]
Question: Why do you have an index.php and an internal.php in both directories?

The way you have it is fine, if you want to maintain more than one instance of CI. Here's what mine looks like (where app1, app2, etc. are the different applications I have running on CI)

Code:
/ci/
    system/  <-- this is where CI core lives
    app1/
    app2/
    app1.php
    app2.php

Then in those .php files I mod that one line:

Code:
app1.php line 49 is:

$application_folder = "app1";


Code:
app2.php line 49 is:

$application_folder = "app2";


Then each of my "app" folders have all the stuff you typically find in the "/system/application/" folder, like so:

Code:
/ci/app1/
         config/
         controllers/
         errors/
         helpers/
         hooks/
         includes/
         index.html
         language/
         libraries/
         models/
         views/





[quote author="gp177" date="1223585168"]Thanks for the response (especially that link).

Currently my directory structure looks like this.

/inetpub/
/system/
/wwwroot/
index.php
internal.php
/inetdev/
/system/
/wwwroot/
index.php
internal.php

However if this doesn't work I will have to rethink our layout and maybe move to one of the suggested layouts.[/quote]

#5
[eluser]gp177[/eluser]
One of the applications is a development site. It has it's own domain name, login application, and database. Our system is setup so that we can checkout to the development site, inspect that everything is working correctly, then deploy it to our live site.

I am open to any suggestions if anyone has a better idea how to do this but it seemed to be the most logical solution to us.

#6
[eluser]gp177[/eluser]
Has anyone else experienced this problem?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.