Forum Moderators: phranque
We have a web server running Apache, and have recently acquired a new subdomain which will eventual phase out the old sumdomain.
Currently both these URL's would resolve to the same resource:
www.oldsub.dom.edu
www.newsub.dom.edu
The uni's DNS has entries for the machine's IP so either address resolves without issue.
We're going to phase out the old subdomain and replace it, but we'd like to track user access to our sites through one or the other. We use AWStats, but with a single log file, it can't distinguish the different subdomains (with seperate AWStats config files, we end up with the same stats).
So, is there a way to have our Apache host resolve both those URL's to the same resource, BUT log that traffic into different log files?
Thanks,
-B
SetEnvIf Host newsub\.uni\.edu site=newsub
CustomLog logs/newsub_log combined env=site-newsub
I'm trying to set "site" equal to "newsub" if the requested URL contains "newsub.uni.edu". Then, I'm trying to log into the "newsub_log" file in the combined format if "site" equals "newsub".
But I'm nothing is being written to the new log file. Rather, all the traffic from both oldsub and newsub based URL's is getting written to the main log file.
So essentially, the above does nothing.
Anyone throw me a bone?
-B