You can’t. Apache doesn’t know what id belongs to what name.
Do you have access to the main Apache config httpd.conf? If so, you can use a RewriteMap with a script that accesses the database.
If not, I’m afraid you’re only option is to code all redirects by hand. Or see if there is some WordPress plugin that can handle the redirection for you or see if there is someone that can write one for you. Or write it yourself if you know PHP