reformed reformed - 1 year ago 75
Apache Configuration Question

Is there a way to view hits for specific .htaccess rewrite rules?

Does Apache log requests that get met with a specific .htaccess rewrite rule? Is there a way to know which rewrite rules are actively being triggered?

For example, if I have 5 rewrite rules, is there a way I can see that rule #1 has been triggered 100 times, #2 200 times, #3 52 times, etc.?

Answer Source

(Making this an answer instead of comment)

Yes, you could enable logging for mod_rewrite and then parse the Apache error log for the expression. It would log a ton of info, probably not something you would want to do regularly on a production server. See Apache documentation at: It will log entries like: RewriteCond: input='/blahblah' pattern='!^/site/' => matched, where input is the request and pattern is your rule. I'm not aware of any other way, unless you implement some logging in the pages that are executed as the result of the rule.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download