There are several ways to do this.
You can use mod-rewrite to overwrite foo in foo.php so that requests for / bar are handled by / bar.php.
You can use the default directories and files to refer to directcory / foo /, which is handled by /foo/index.php
You can set the php script as a handler for 404 errors, then you simply link to unused files, and the file handler deals with it, no matter how much it likes. (usually using some map from url to php file)
You can tell your web server that all requests for a specific web server should be handled by php.
The first or second solution is the simplest, but the last two offer the best flexibility, and their options are what most of the larger frameworks do.
Agrajag
source share