@bharat I’ve use this middleware for my apps and it works well:
https://www.slimframework.com/docs/cookbook/route-patterns.html
// removes last backslash so /route or /route/ will work
$app->add(function ($request, $response, $next) {
$uri = $request->getUri();
$path = $uri->getPath();
if ($path != '/' && substr($path, -1) == '/') {
$uri = $uri->withPath(substr($path, 0, -1));
return $response->withRedirect((string)$uri, 301);
}
return $next($request, $response);
});
Alternatively you could use this for your route:
$app->get('/user[/]','');
But you would have to do this on all of your routes.