0

I am trying to configure codeigniter with multiple application which will share common CI resources,

I did renamed application to applications and created two applications like below,

www\app1\application\controller...models...view
www\app2\application\controller...models...view
www\system\

and id1.php and id2.php are duplicate of index.php,

then i changed application path in app1.php and app2.php as below,

in app1.php -- $application_folder = $_SERVER['DOCUMENT_ROOT'].'app1/application';

in app2.php -- $application_folder = $_SERVER['DOCUMENT_ROOT'].'app2/application';

and created .htaccess file as below,

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app1/id1.php/$1 [L,QSA]

Problem...

When i load http://localhost/app1/welcome, it work fine, but when i load http://localhost/app2/welcome it throw 404 page not found. I assume this is because htacess file, how to add two id1.php and id2.php in htacess file?

Thanks,

rjcode
  • 1,193
  • 1
  • 25
  • 56
  • I don't know if what you are trying is possible, but when you access the url `http://localhost/app1/welcome` ci would look for a controller named `App1.php` and a method `welcome` in that controller. which clearly is not available. – Sayantan Das Dec 02 '16 at 14:24
  • 1
    @SayantanDas, but it is mentioned same in user guide, http://www.codeigniter.com/user_guide/general/managing_apps.html – rjcode Dec 02 '16 at 14:56
  • Okay i have gone through the doc. Try changing the url to `http://localhost/app1.php/welcome` – Sayantan Das Dec 02 '16 at 15:49
  • Are you really wanting to share the application folder? Or are you more looking to share the main CI system files? – cfnerd Dec 02 '16 at 15:50
  • @cfnerd, i want to share only CI system files – rjcode Dec 02 '16 at 15:59
  • @SayantanDas, yes i could able to use that url, but now i had modified some structure, can you tell me how to add two index,php files in htaccess to remove index.php? – rjcode Dec 02 '16 at 16:19
  • 1
    I'm not good with htaccess, but i found these http://stackoverflow.com/questions/3531504/codeigniter-multi-application-htaccess-problem http://stackoverflow.com/questions/22307685/codeigniter-multi-application-htaccess-issue you can have a look at them – Sayantan Das Dec 02 '16 at 18:23

0 Answers0