How to Create a New Index Inside a Subdirectory in Codeigniter

I am using codeigniter framework in my php project and I have a requirement like this:

When the url is */admin/, the application should call the index.php inside the admin folder.

Folder structure:
+codeigniter app
 +application
  +controller
   +index.php (the application's default)
   +admin (the admin's index.php should be here)
    +index.php
  +config

Looking at the codeigniter's documentation on URI Routing, this can be achieve by adding this line on: application/config/routes.php


$route['admin'] = 'admin/index';


I love codeigniter!

1 Comments

Post a Comment

Post a Comment

Previous Post Next Post
NERV Open Source

Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.

Explore NERV on GitHub →