This is highly dubious—you're talking about two completely different resources at that point.
If I send you a link to a page on a dynamic site written in PHP like standardebooks.org, and then I send you a link to the GitHub repo showing the source of the script responsible for intercepting the request and responding with the page that you actually see when you visit the first URL, are those really two different representations of the same resource? Or two different resources? It's the latter.
There is a desire to rectify/reconcile this with WebDAV, because you want to be able to "address", say, cart.php—which is in principle not a bad thing (it's very much a good thing, really)—but merging two resources into the same namespace is not the solution, and bad hygiene should not be excused.