I wan’t to divide my CI into multiple applications. I should say that it is within a folder called app on the root /var/www/app/. First I tried this setup:
/system/
/application/
/app1/
/app2/
app1.php
app2.php
.htaccess
But I couldn’t get my htaccess to point correctly. Therefore I went ahead with this:
/system/
/app1/
.htaccess
/application/
index.php
/app2/
.htaccess
/application/
index.php
And now it works fine with urls: mysite.com/app/app1/index.php/welcome – but I would like to hide index.php from the URL. Therefore my .htaccess looks like this:
RewriteEngine on
RewriteCond $1 !^(index\.php|gfx|css|js|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
However it is not working, I get 404 when trying to access mysite.com/app/app1/welcome.
Could someone clarify whats wrong with my .htaccess? I have another .htaccess on the root and will run some wordpress from there, but would it affect my /app folder where CI runs?
Thank you so much!
Alright so it’s working now. After some hours of debugging. I’m not sure exactly what did the trick, but I think I was missing a
AllowOverride Allin my default vhost. After apache restart and this htaccess in every /app/app1/ folder it started working:Thanks to everyone who contributed to my question.