awstats rewrite rule?

Using a single web hosting account to host multiple sites

awstats rewrite rule?

Postby MadDog » Fri Jul 28, 2006 5:46 am

Hi,

I've got a server which runs multiple sites, using NameVirtualHost. I have AWStats installed, for obvious reasons. Apache is configured that the site's stats are reachable by an URL in the form http://www.some-domain.com/stats/awstat ... domain.com

I guess you already know the thing I'm trying to do here, but is there a way I could get

"http://www.some-domain.com/stats/" rewritten to "http://www.some-domain.com/stats/awstats.pl?config=some-domain.com"

where some-domain.com is not hardcoded? One note has to be added: there could be other subdomains than 'www'.
MadDog
 
Posts: 1
Joined: Fri Jul 28, 2006 5:37 am

Postby richardk » Fri Jul 28, 2006 6:11 am

In a .htaccess file in the /stats directory:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?(.+)$ [NC]
RewriteRule ^$ /stats/awstats.pl?config=%2 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 89 guests

cron