Reputation: 3
My code igniter project is returning 404 whenever I use method that I created in controllers. I have it running on Mac OS Mojave on Apache2. There might be configuration or setting that I missed.
The codeigniter page works fine when opening http://localhost/myproject where I see the welcome page. I have a 404 problem when I start using the new controller class. To make it simple, I created below "Pages.php" controller file inside application/controllers folder:
<?php
class Pages extends CI_Controller {
public function view()
{
echo "running the view method";
}
}
I expected the page to display "running the view method" but the result is a 404 page at http://localhost/myproject/view or http://localhost/myproject/index.php/view.
Upvotes: 0
Views: 20