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!
How to create a new index inside a subdirectory in codeigniter How to create a new index inside a subdirectory in codeigniter Reviewed by czetsuya on Saturday, August 01, 2009 Rating: 5

1 comment:

Anonymous said...

thanks...

So simple and yet so effective!

Powered by Blogger.