Codeigniter always opens a welcome page
change:
Solved - Mod_rewrite issue was
I am unable to get CI to work as described in the tutorial. No matter how I play with paths or settings - it doesn't work.
My setup:
- ubuntu on local machine
- no
.htaccess
- default routing
- configuration:
-
$config['base_url'] = 'http://localhost/~myuser/ci/';
-
$config['index_page'] = 'index.php';
-
$config['uri_protocol'] = 'AUTO';
-
- one controller named users.php class Users with method "listone"
I am trying to call
- http: //localhost/~myuser/ci/index.php? users / listone -> welcome page
- http: //localhost/~myuser/ci/index.php/users/listone → 404
I had a different routing configured to use the default users / listone. This works, but then I was unable to access other methods.
What am I doing wrong? I tried to follow the tutorial, but it doesn't seem to work as described.
edit: even if slash at the end of base_url doesn't work, not when empty
I get a 404 server when I call index.php / users / listone, not the one that has CI.
Controller: Added Index Method. - which is not available
<?php
class Users extends CI_Controller {
public function listone($page = 'listall')
{
echo $page;
}
public function index()
{
echo 'listone';
}
}
+3
source to share