I have designed a website, it was working fine, but lately I modified the links for SEO purposes. I just replaced _ with -. Now I am getting a route not found error.
This is the matching array
$routes = array(
array('url' => '/^products\/(?P<cat>\w+)$/', 'controller' => 'products', 'view' => 'products_list')
);
The link goes like this
When I remove - or replace it with _ it works.
Change your regex from the shorthand character class
\w, which matches letters, digits, and underscore, to a more explicit one to match upper and lower case letters, digits,_, and-.