Response error when request wrong URL

According to I use slim PHP for my API and public/index.php I config only 2 types of URL


How can I response error if user request wrong URL?

Looks like a typical basePath issue.