Hi guys 😊
I get 404 error on remapping codeigniter, here is my scenario:
1-I have a controller: USER 2-When my user has logged in, it will redirected to USER/DASHBOARD but I don’t have any function by name DASHBOARD in USER controller, I gave it an specific controller by name DASHBOARD but when I go to USER/DASHBOARD it gaves me 404 error…
Here is what I’ve done up to now:
1- my root .htaccess file:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
RewriteCond $1 !^(index\.php|images|css|robots\.txt)
2- my config.php changes:
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
3- my routes.php changes:
$route['user']="user";
$route['user/dashboard']="dashboard";
$route['default_controller'] = "main";
$route['404_override'] = "";
4- I have index() function in DASHBOARD controller which gives me the output text as below:
class Dashboard extends CI_Controller {
public function index(){
echo 'tst';
}
}
Your help is appreciated 😊