Shahid Karimi
Shahid Karimi

Reputation: 4357

creating admin folder inside CodeIgniter App

I have the front end fully working in a codeIgniter application. Now, I have to create admin as well. So, How would I create the admin section creating a new directory. Without interrupting codeigniter directory structure.

localhost/myapp/admin

Upvotes: 2

Views: 5077

Answers (3)

Jorge Guberte
Jorge Guberte

Reputation: 11054

There's an explanation about that in CI User Guide: Managing your Applications

Upvotes: 0

minboost
minboost

Reputation: 2563

CodeIgniter already supports 1 subfolder level within the controllers folder. So within /applications/controllers/ you can just add /applications/controllers/admin/ and it will work fine.

Upvotes: 3

chris
chris

Reputation: 36937

you could omit it out via .htaccess so that the directory actually works like a directory rather than how its initially developed to work.

RewriteEngine on
RewriteCond $1 !^(index\.php|admin|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

what this does is turn on apache modrewrite then tells apache any calls to index.php, robots.txt or yourdomain.com/admin/ (and any sub-folders/files within) treat as you would normally without codeigniter mucking up the works. Also this will remove the required index.php from the URL you will be able to link to your site like

mydomain.com/home/ instead of mydomain.com/index.php/home/

Upvotes: 0

Related Questions