I'm having trouble accessing pages or controller to be exact in codeigniter. The default controller working fine, but when I create a new controller it can not be accessed, when I exceute the url http://localhost/codeigniter/admin/login
it shows error 404 Page Not Found. Here's my controller code, located in Codeigniter/applications/controllers/admin/Login.php
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
class Login extends CI_Controller
{
public function index()
{
$data = array(
'title' => 'Login Administrator',
'isi' => 'admin/login_view'
);
$this
->load
->view('admin/login_view', $data)
;
}
}
and here's my config code :
$config['base_url'] = 'http://localhost/codeigniter/';
$config['index_page'] = 'index.php';
and here's my .htaccess file, located in the root folder (CodeIgniter)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
I'm using local server XAMPP, I did enable the rewrite module, changed the httpd.conf AllowOverride None to AllowOverride All, but still won't working. I'm stuck at this point so please help :) Thankyou.
Aucun commentaire:
Enregistrer un commentaire