Slim treats a URL pattern with a trailing slash as different to one without. That is,
/user/ are different and so can have different callbacks attached.
If you want to redirect all URLs that end in a
/ to the non-trailing
/ equivalent, then you can add this middleware:
Alternatively, consider oscarotero/psr7-middlewares’ TrailingSlash middleware which also allows you to force a trailing slash to be appended to all URLs: