Implementation of the 4042302 concept in PHP, to be set up as an ErrorDocument
on Apache for example.
It adds a HEAD request to the fallback server to check if it would serve the requested path.
This allows to differenciate legacy requests from actual 404 and serve the most appropriate content:
- fallback to a subdomain for the former,
- custom 404 page for the later