In my local site
http://localhost/giftsware/nl/products/details/2382
This is my browser url for product description page now I want more user friendly url for product description page. I want to change above url to
http://localhost/giftsware/products/2382
I tried by routing all calls to details by adding
$route['products/(:any)'] = "nl/products/details/$1";
this is in routes.php file, but it gives me 404 error. What could be the possible issue and how can I fix it?
this is my complete route file code
$route['(:any)/products/(:num)'] = "products/details/$2";
$route['default_controller'] = "pages";
$route['404_override'] = '';
$route['^en/admin/([a-zA-Z_-]+)/(:any)'] = '$1/admin/$2';
$route['^en/admin/(login|logout)'] = 'admin/$1';
$route['^en/admin/([a-zA-Z_-]+)'] = '$1/admin/index';
$route['^nl/admin/([a-zA-Z_-]+)/(:any)'] = '$1/admin/$2';
$route['^nl/admin/(login|logout)'] = 'admin/$1';
$route['^nl/admin/([a-zA-Z_-]+)'] = '$1/admin/index';
$route['admin'] = 'admin';
$route['pages/(:any)'] = "pages/index/$1";
$route['^nl/(.+)$'] = "$1";
$route['^en/(.+)$'] = "$1";
$route['^nl$'] = $route['default_controller'];
$route['^en$'] = $route['default_controller'];
Try it
Using .htaccess files
Using php