Hi, i'll try explain this as thoroughly as i can: I have a number of websites all on the same dedicated server. I pay for advertising with google, overture, etc, and I am wanting to track where my referrals are coming from so as to work out how best to spend my advertising budget. To achieve this, I have written a PHP script that logs the referer URL along with some other information to a database. The problem is that I don't really want to go through every page of every site adding this script to the top of each, because there are lots, and more planned in the future. Not to mention the majority of the pages are HTML, not PHP. Can anyone tell me how (or even if) I can add something to the .htaccess that will automatically execute this script whenever a page is requested? Or any other solutions that would acheive the same result? I've used a few Rewrite rules before, but that's about the extent of my Apache experience.