Hey everybody,
I need some help with setting up a .htaccess file for my EE2 installation. I have a web folder, where my index.php file takes place:
/folder/.htaccess
/folder/index.phpWhat I have there as well is another folder with its own index.php and .htaccess file:
/folder/cifolder/.htaccess
/folder/cifolder/index.phpSo, “folder” is the EE2 one, while “cifolder” is referring to CodeIgniter website. The end goal is:
http://website.com/ - to open EE website http://website.com/cifolder/ - to open CI website
This is what I currently have in /folder/.htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]It does the magic, if I open http://website.com/cifolder/. However, if I try http://website.com/cifolder/something-else, I get 404 from EE. What else do I need to put in my .htaccess file?
Thanks! 😊
I’m no .htaccess expert but I’d try:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|cifolder)
RewriteRule ^(.*)$ index.php/$1 [L]…so that your cifolder links do not get handled by EE.
And then inside the “cifolder” put another .htaccess to handle removing that nested index.php using code like what you’ve posted.
Here is what I use on my site:
RewriteEngine on
RewriteCond $1 !^(index\.php|admin\.php|app1\.php|app2\.php|assets|lib|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]Everything is passed to index.php except the things I list explicitly.
admin.php, app1.php, app2.php are all loaders (admin is EE backend, app1 and app2 are CodeIgniter apps).
I keep all my images, css, javascript in the ‘assets’ folder, so calls to one of these look like this:

Hope this helps.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.