Like everybody else, I wrote my own router which somehow began to grow and became a so-called microframework:
http://azuki.desfrenes.com/This is probably what I would use for PHP, but obviously other languages have better solutions like ruby/sinatra, python/flask etc.