I have 2 web servers. One hosts my main website (www.site.com), and the other hosts a subdomain (sub.site.com). The way I have it set up, any time you go to the subdomain, it routes through the main server first, using mod_proxy. On the main web server I have a php script that logs information any time a web page is accessed. What I would like to happen is anytime someone accesses the subdomain, the logging script runs on the main server before sending the request on to the subdomain server. Is this possible?
How about a cURL request from the subdomain to the main site, passing along all of the request headers?