I have a application/controller/login.php file containing the following
class Login extends Controller { function Login() { parent::Controller(); } function index() { $this->mysmarty->assign('title', 'Login'); $this->mysmarty->assign('site_media', $this->config->item('site_media')); $this->mysmarty->display('smarty.tpl'); } }
My routes definition looks like the following:
$route['default_controller'] = 'welcome'; $route['login'] = 'login'; $route['scaffolding_trigger'] = '';
The problem is that I keep getting a 404 when I try to access http://localhost/myapp/login. What did I do wrong? I’ve checked CI routes docs and cannot spot anything.
There shouldn’t be anything wrong with this – does it work without the route? Also, have you set the .htaccess properly (i.e. does http://localhost/myapp/index.php/login work instead)