.htaccess is the best way. The only alternative that I know of is to have a 404 Error document (usually specified in .htaccess ). This however is a global catchall that can be coded for each variation you might have.
Once into your ErrorDocument you can look at getenv('Request_URI') and explode it, stristr it to see what content you need to present.