This post is not going to go into much detail - I have my last lectures tomorrow, before the exams next week, so I really have other things on the horizon, but I can give a brief run-down of what else is involved in using PHP to make clean URIs.
The Content Handler
In the last post, I explained how to set up your .htaccess file so that all content under a certain directory level (say "/wiki") is handled by a certain PHP script. The next issue is how to set up this PHP script so it can actually serve content.
The PHP script needs to take the requested URI and return the resource. The URI is translated into a file through a lookup table in a MySQL database.
Lookup table
The lookup table can be surprisingly minimal. At the basic level, only two fields are required: The alias, and the corresponding filename.
The PHP script
Note: This is really just an example. Several things are unrealistic in practice; for example, the mysql query is potentially vulnerable to injection attacks.
Of course, you can do a lot more with this: Setting different content types and handling graphics as well as text, even including PHP programs that are themselves content handlers for resources lying further down the directory tree. In one website I just made, I use a regular expression match to replace certain links and add a visitor counter to html files before displaying them on the page - without having to change the original files!