Vasanthan.R.P
Vasanthan.R.P

Reputation: 1287

codeigniter admin panel setup how to implement this

I am new to codeigniter frame work. I have installed CodeIgniter 2.1.4 version. I set up the application and system path in my local wamp server. The front end opens fine. But when i try to open the admin i.e http://siteurl/CodeIgniter_2.1.4/admin

it shows as 404 not found. In application >> controllers >> admin.php is found (Hope this is for admin panel)

Then why it shows as 404 not found. Shall i made any setup for admin url? Please help me. Thanks

Upvotes: 0

Views: 1533

Answers (1)

complex857
complex857

Reputation: 20753

You will need multiple things in place in order to achieve this:

  1. Set the $config['index_page'] to an empty string in application/config/config.php
  2. You will have to rewrite the requests coming in, for example with apache you will need to have rewrite rules like this:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?$1/ [L,QSA]
    

    You can put them into a file called .htaccess next to the index.php (your webserver need to be configured to support these kind of files for this to work)

  3. You will have to have a function called index inside your admin.php, inside a class called Admin.

Upvotes: 2

Related Questions