Codeigniter 3.0 routing problems

537 Views Asked by At

I'm new in Codeigniter framework and got routing problem. I have Main controller and Tournaments controller. My routes look like this:

$route['default_controller'] = 'main';
$route['main'] = 'main';
$route['tournaments/results/(:num)'] = 'tournaments/results/$1';

When I go to localhost/tournaments/results/1 and then click to link "Main" I got localhost/tournaments/results/main instead of localhost/main

What is wrong with my routes or maybe problem is somewhere else?

1

There are 1 best solutions below

1
On

Probably your link to 'Main' is wrong, not your routes files. Check your link.