开发者

How can I get a script to run whenever an http request is made?

开发者 https://www.devze.com 2023-03-05 12:04 出处:网络
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 s

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. I开发者_C百科s this possible?


How about a cURL request from the subdomain to the main site, passing along all of the request headers?


Could you use a front controller style that redirects every request as needed? Or maybe make a pointcut and attach logging code transparently by using Aspect Oriented Programming?

0

精彩评论

暂无评论...
验证码 换一张
取 消