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.
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]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With