I have two versions of my website: a full site for desktop browsers, and a mobile site which contains mobile-friendly versions of some of the pages from the desktop site. The urls for both sites are identical when viewed from outside, an internal device recognition layer sends users to one site or the other depending on the User Agent.
I would like to configure Apache to detect when someone tries to access a page on the mobile site which does not exist, and forward them on to the same page on the desktop site. Some rule like this is what I have in mind, is it possible?
ErrorDocument 404 http://<ip of desktop site>/<request url without hostname>