Hi!
in my opinioni this is a server script thing, since the server will interpret .../1 as a file ... which doesnt exist of course, so hell answer with a 404 page...
what you'll have to do is writing a shellscript that takes any request for a nonexisting file and rewrite it to ?id=var_request
that should be possible, on a *nix box at least.
the only other solution that i can think of is replacing your 404 error page with a php file that has a look into the page that would have been called, checks whether the requested page handle equals a valid id and - if that is the case - forwards the user to index.php?id=value
and if not to the 404 page.
ive never done that before so you'd have to try it.
greetings, jakob