• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Nested CI installation doesn't work

I know this is a common problem - setting multiple installations - but I was unable to fix the issue.

I have 2 versions of a website - the second one is a translated copy-paste (no multilingual support required, user request). So:

http://mysite.com - this one works OK
http://mysite.com/en - this one doesn't.

I suppose there is an issue either in my .htaccess files or in my index.php. I've set the base path in config.php for both projects. I've extracted the application folders to the same depth as the system folders (so there are application, system, css, .htaccess, index.php etc). I've also removed the 'index.php' from the URL. Both projects work if alone at root level or only 1 of them is in a subdirectory.

Here there is the .htaccess for the first (root-positioned) project that works:

RewriteEngine On
RewriteCond $1 !^(index\.php|images|css|js|en|ckeditor|robots\.txt)
RewriteRule ^(.*)$ /index.php?/$1 [L]

AddType application/x-httpd-php5 .php
<IfModule mod_rewrite.c>
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php

I suppose there is some recursive rule that overlaps my nested app, but not sure - tested many different cases. As you see, I've excluded 'en' folder with my rule not to confuse with part of the first project.

This is the nested .htaccess:

RewriteEngine on

RewriteCond $1 !^(index\.php|images|css|js|ckeditor|robots\.txt)
RewriteRule ^(.*)$ en/index.php/$1 [L]

I've tried different rules - trailing or missing en, full path etc.

Any ideas? My index.php's are standard.

Take a look at the above site and also follow this link


Thank you for the link - actually I haven't even doubted that it should be possible to create multiple apps on one hosting account. Indeed, I'm surprised that it has to be that complex. Ain't there a reasonable way to implement such a behavior without a middle layer - the _menu.php in your way?

I don't find it that unexpected behavior to have 2 apps on root (/) and subfolder of root (/en/). I've implemented both features alone: my hosting account has a CI app on the root and it works great. My testing environment has wordpress on root and CI as a subfolder. So I definitely have to be able to deploy 2 apps on one server, right?

I'm still brainstorming on the htaccess idea... Any comments on that suggestion appreciated.

Here there are couple of guides that might be of any help - there is light in the tunnel, metaphorically.

Setting multiple sites - useful, although it requests Apache reconfiguration (not applicable on shared hosting)
Subdomain thread - switch HTTP_HOST for multiple subdomains
Routes hacks

and 2 more questionable:

Change the uri_protocol?
htaccess tips - I still think we could workaround with overloading this htaccess.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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