Eslam Zedan
Published in : 2022-02-22
Hello,
I am working on old CodeIgniter 2
project I added a new route to application/config/routes.php
here is the new file:
$route['products'] = 'products/index';$route['product/(:num)'] = 'products/single/$1';$route['(:any)'] = 'pages/$1';$route['product/(:any)'] = 'products/search/$1';$route['default_controller'] = "home";$route['404_override'] = '';
the request does not go to Products
class, it returns 404 not found
Here is my controller:
<?phpclass Products extends CI_Controller { public function index() { #### Some Code #### } public function single($id) { #### Some Code #### } public function search($text) { #### Some Code #### }}
Any help,
Thanks
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Yasen Sayed Date : 2022-02-22
Best answers
8
Best answers
8
Hey, Please try this approach add index.php before your route name for example:
I think the problem is from the .htaccess file.
Eslam Zedan Date : 2022-02-23
No that is not the problem, every other route is working fine
Yasen Sayed Date : 2022-02-23
I find the problem in the route order.
Eslam Zedan Date : 2022-02-23
Best answers
8
Best answers
8
Thank you that work fine