Modify awstats .htaccess 'template'

webunity

Verified User
Joined
Sep 23, 2014
Messages
49
Where can i find the awstats .htaccess 'template'? I have some domains with a faulty .htaccess in it, and i want to prevent newly created domains to get that same mistake..

Thank you,
Gilles
 
It's been a while, but: bump (same question!)

I'd like to add

Apache config:
AddHandler cgi-script .pl
Options +ExecCGI

to it by default
 
If you're referring to the /home/USER/domains/DOMAIN.TLD/awstats/.htaccess , I believe its content is generated/controlled via the following script:

/usr/local/directadmin/scripts/awstats_process.sh

I just ran this script for a user, and my newly generated .htaccess file contains the following:


Code:
Options -Indexes +ExecCGI
AddHandler cgi-script .pl
DirectoryIndex awstats.pl

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.tld$ [NC]
RewriteRule ^(.*)$ http://domain.tld/awstats/$1 [R=301,L]
 
Yes! thank you :D

I see that the .htaccess content is overwritten when you change the domains CGI settings. Also removing my htpassword settings :rolleyes:
 
Okay, so here is what you can do.

Code:
cp -a /usr/local/directadmin/scripts/awstats_process.sh /usr/local/directadmin/scripts/custom/

Now, edit the code in that custom/awstats_process.sh script to make test for/add the .htaccess contents you want.

That's it.

You can then test by triggering the dataskq:

Code:
echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue ; /usr/local/directadmin/dataskq d2000

Now, check the contents of the .htaccess file to make sure they are as desired. :)

Also, under Dashboard/User Statistics in the user panel, you can click the checkbox next to the domain, and then options for "Make Statistics Publicly Viewable" and "Remove public stats" are available (Evolution theme). Did you happen to notice these, or did you just want them to be publicly viewable with htpasswd authentication?
 
Back
Top