0
votes

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

1
Can you please paste content of admin.php ? Also please explain how do you call "front end" and where is that file located? - fobus

1 Answers

2
votes

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.