I want to change the url on osclass and replace the , with -
now url is like : 127.0.0.1/en/search/region,9354963/category,books-magazines and I want to convert url to 127.0.0.1/en/search/region-9354963/category-books-magazines
I did try to change the init() in classes/Rewrite.php and add the code :
$modified_params = array();
for ($p = 1; $p < count($route_match); $p++) {
$param_value = str_replace(',', '-', $route_match[$p]);
$modified_params[] = $param_value;
}
// Set the modified parameters to Params
for ($p = 0; $p < count($modified_params); $p++) {
if (isset($args[1][$p])) {
Params::setParam($args[1][$p], $modified_params[$p]);
} else {
Params::setParam('route_param_' . ($p + 1), $modified_params[$p]);
}
}
but still no luck
You cannot replace , with -, as it would not be possible to differentiate between - in slug and delimiter of param and value.
Example: /region-alabama/city-bremen
It is not possible to identify if this is category structure or search url structure. As far as I know, comma is seo friendly char and there is no need for its change, but if you really want to do it, it will not be sufficient to change just this piece. Still, you will need to use different char like dot as example.