Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Igniter Project Folder

I have a code igniter project folder. Everything works fine. But when i placed the project folder in another folder as a sub-folder, i get 404 Page Not Found for the Controller URLS i called.

For instance the CI url is http://localhost/library Then i place it in another folder like : http://localhost/school/library

How do i solve this problem? I know its a directory problem. Thank you.

.htaccess file :

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

Structure of folder

    school/
          students/
          teachers/
          library/
                 application/
                 system/
                 assets/
                 index.php
                 .htaccess

The library folder is using code igniter frame work but the school folder which is the main folder is using no frame work.

like image 648
Jayden Avatar asked Jun 06 '26 16:06

Jayden


1 Answers

create a file named .htaccess and put this code in

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L]
like image 101
Terchila Marian Avatar answered Jun 09 '26 07:06

Terchila Marian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!