Linking to a php site located in a subdirectory of the Drupal site
Well, I ended up going the JavaScript approach. I don't know how to get around using absolute links to the subsites without doing something pretty hacky, so I created a module that adds a javascript file when NOT in the production environment. The javascript searches all links for hrefs with the production domain and changes them to use the current page's domain.

Hence, in production the module does nothing, but in any other environment it replaces the absolute links.

Not optimal, but a workable solution for my case...