CodeIgniter Forums
Problem with subdirectories and .htaccess - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with subdirectories and .htaccess (/showthread.php?tid=10406)



Problem with subdirectories and .htaccess - El Forum - 07-30-2008

[eluser]Bramme[/eluser]
Okay, I've ran into a spot of trouble using an index.php file in a subdirectory.

My site structure looks like this

/index.php
/application_folder
/system
/admin/index.php
/admin/application_folder (refers to the system folder in the root)

When I go to mysite.com/admin/ everything works, my default controller gets loaded etc, but when I go to mysite.com/admin/general (the default controller) I get a 404 error from my root application, I presume because of the conflicting index.php files.

I am hoping to fix this problem, but I'm using the super .htaccess file and I have NO idea how to do this (I barely understand Apache)... Could anybody help me with this? Or should I just rename my admin index.php file to smth else?


Problem with subdirectories and .htaccess - El Forum - 07-30-2008

[eluser]xwero[/eluser]
The way i would do it is to create a admin directory in the application folder. I can't think of a reason to move the admin section out of the application?

But as far as the .htaccess file is concerned i think the only thing you have to do is to add admin/index.php to the exception list.


Problem with subdirectories and .htaccess - El Forum - 07-30-2008

[eluser]Bramme[/eluser]
Hmm, I only read up on application subdirectories after I managed my current directories. I'm using a separate application because my admin part will consist of multiple controllers, and it'd be easy if I could autoload stuff. But not everything that's autoloaded is needed for my content controller.

It'd be cool if you could exclude certain controllers from autoload.