3

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

www.example.com/awstats/awstats.pl?config=awstatsconffile.org

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

www.example.com/stats/

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

Any idea?

1

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 /

#Redirecting
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.

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

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.

| improve this answer | |

Your Answer

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