What you are looking to accomplish can be done via proxy. It sounds like your server is Apache because there are several mentions of htaccess without correction (Nginx doesn't use it).
I am not an Apache expert (I use Nginx), so I can't give you an exact example solution. I have only implemented reverse proxies with Nginx.
I recommend reviewing Apache's docs on the topic (below) and asking this on ServerFault.
https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html
https://httpd.apache.org/docs/current/mod/mod_proxy.html
There are several considerations you should think about:
- Handling SSL
- Setting the proper headers
- Catching 404s
If you have a 404 page you could use that url instead of catching the requests.
For the record, I realize this is not an exact answer, but I don't have enough reputation to comment yet.
.htaccess
. You will need to do something in WordPress itself - either a plugin or hijack the 404 response/page somehow.