htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Rewrite for Awstats
PostPosted: 08 Nov 2006 22:27 
Offline

Joined: 30 Oct 2006 19:55
Posts: 99
RewriteAwstats

Here's a recipe for awstats using mod_rewrite. The page is protected by an access control list allowing access from a sepecific network, as well as asking for a username and password if you try to access from elsewhere.

Place this within your virtualhost(s), and go to [WWW] http://yoursite.example.com/stats.

Code:
  ## Enable rewriting
  RewriteEngine On

  ## Rewrite matching URLs
  RewriteRule /awstats-icon(.*) /usr/share/awstats/icon/$1 [last]
  RewriteRule /stats(.*) /usr/lib/cgi-bin/awstats.pl$1 [last]

  ## Restrict access to awstats
  <Location /stats>
    SetHandler cgi-script
    Order deny,allow
    Deny from all
    Allow from 192.0.2.0/24
    AuthName "Lies, damn lies and statistics"
    AuthType basic
    AuthUserFile /etc/apache2/passwd
    Require valid-user
    Satisfy any
  </Location>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB