CodeIgniter Forums
Problem with routing to admin panel - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with routing to admin panel (/showthread.php?tid=48203)



Problem with routing to admin panel - El Forum - 01-08-2012

[eluser]Unknown[/eluser]
Hai everyone,

Iam new to codeigniter i used it it is really nice framework.

can anyone help me to route to admin area?

this is my folder structure

Quote:controllers/
admin/index.php
user/index.php

views/
admin/index.php
user/index.php

the user section is working fine

http://localhost/mysite/index.php

when i type http://localhost/mysite/admin

i got a error like this

The requested URL /mysite/admin was not found on this server.

this is my routes.php file code

Code:
$route['default_controller'] = "user/welcome";
$route['admin'] = "admin/login";

$route['admin/(.*)']         = 'admin/$1';
$route['admin']         = 'admin/login';
$route['(.*)']              = "admin/$1";  

$route['404_override'] = '';

my admin/index.php code is like this
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends CI_Controller  
{

    public function index()
    {
        
    }
    public function login()
    {
        $this->load->view('admin/index');
    }
}


Can any one please help me?

Arunkumar