You would need to redesign your system. You can't redirect from a 404 because no page exists, unless you want to redirect ALL 404s to some other page (like your home page).

You could use .htaccess...