Awstats with Apache and mod_rewrite

I recently setup a new Awstats install and used mod_rewrite to make it easier to view web stats. Using the following configuration within a virtual host declaration, you can simply make requests in the following format:

http://awstats/$CONFIG/$YEAR/$MONTH/$DAY/

This is assuming that you run daily rollups.

  ServerAlias awstats

  RewriteCond %{REQUEST_URI} !^/awstats/awstats.pl [NC]
  RewriteCond %{REQUEST_URI} !^/icon               [NC]
  RewriteRule ^/(.*)/(.*)/(.*)/(.*)/ http://%{HTTP_HOST}/awstats/awstats.pl?databasebreak=day&day=$4&month=$3&year=$2&config=$1 [L,NE]

Comments

One response to “Awstats with Apache and mod_rewrite”

  1. Is it possible to use AWStats to log pages that use mod_rewrite for pages handled by index.php e.g. page/1 page/one etc rather than index.php

Leave a Reply

Your email address will not be published. Required fields are marked *