currently in order to access statistics on my site I access this link:


all is working fine, but what I want to achieve is simply this:


I've created the "sites" directory and inside I've created the .htaccess file but without success.

Any idea?


I think you can solve this with mod_rewrite.

Inside your root directory (generally public_html), place a .htaccess file with the following content:

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

RewriteCond %{REQUEST_URI} ^www\.mysite\.org\/stats\/$ [NC]
RewriteRule (.*) www\.mysite\.org\/awstats\/awstats\.pl\?config=awstatsconffile\.org - [L]

I'm not good at regex, so you may need to escape/unescape some characters, but that's the way.

  • 1
    Not Working !!!! . . . . . . . – user13353 Feb 15 '12 at 6:13

Try something like the following in the document root's .htaccess file:

RewriteEngine On
RewriteRule ^stats/$ /awstats/awstats.pl?config=awstatsconffile.org [L]

This will internally rewrite requests for /stats/ to the above URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy