I'm developing my home page, this has a login button on the top right corner. I'd like to display a login page when the "login" text like so:
<li class="nav-item">
<a class="nav-link header-text" href="<?php echo
site_url('Login/login') ?>">Login</a>
</li>
So the controller is called "Login" and the view is "login".
My routing rules in the routes.php file are the following
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
$route['(:any)'] = 'pages/view/$1';
$route['default_controller'] = 'pages/view';
My base url is: http://localhost:8080/ My site url is: http://localhost:8080/index.php
And my .htaccess file looks like this:
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>
The way this is currently setted up is not working for routing, i get a 404 not found message if i click the login and i get redirected to this url: http://localhost:8080/index.php/Login/login.html Can you please help me troubleshooting this problem? thanks!
EDIT: Here's the Login controller code:
<?php
class Login extends CI_Controller {
public function view($page_name = 'login')
{
if ( ! file_exists(APPPATH.'views/pages/'.$page_name.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}
$data['title'] = ucfirst($page_name); // Capitalize the first letter
$this->load->view('templates/header', $data);
$this->load->view('pages/'.$page_name, $data);
$this->load->view('templates/footer', $data);
}
}