Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from stackoverflow.com Nov 4 '10 at 11:15

This question came from our site for professional and enthusiast programmers.

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.

share|improve this answer
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.