What you need is a routing component that links url's to classes/functions in your code that do stuff. This component execute certain class/function depending on your request.
In this question, different strategies are discussed, although there are some already existing frameworks missing that are interesting:
You could use any of those to do exactly what I mention earlier. For example, using the Symfony Routing Component, you could have your routes (potential urls) in a config file like:
# routes.yml
route1:
path: /foo
defaults: { _controller: 'MyController::fooAction' }
route2:
path: /foo/bar
defaults: { _controller: 'MyController::foobarAction' }
So when the requested uri matches with "/foo", the method fooAction from the class MyController is executed.
If you are not sure about how to implement this in your existing codebase, I'd strongly recommend you to read a series of posts about how to use different Symfony components in your code, written by Fabien Potencier. There is a specific post about the routing part.
As for the need to remove "index.php/" from your url, you need to rewrite it. If you are using Apache, you need to add the rewrite rules in your virtual host configuration file, or just create an .htaccess file in your document root. There are hundreds of questions in StackOverflow about this (like this one), and plenty of documentation in the official documentation page.