I've 2 web servers. One hosts my primary website (www.site.com), and also the other hosts a subdomain (sub.site.com). Generate an income get it setup, when you visit the subdomain, it routes with the primary server first, using mod_proxy. Around the primary web server I've got a php script that logs information when a web site is utilized. What I must happen is anytime someone accesses the subdomain, the logging script works on the primary server before delivering the request onto the subdomain server. Is possible?

What about a cURL request in the subdomain towards the primary site, passing along all the request headers?

Would you make use of a front controller style that redirects every request when needed? Or possibly create a pointcut and fix logging code transparently by utilizing Aspect Oriented Programming?