HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Developers' Forum (
-   -   Changing default .htaccess in stats folder (

dclardy 6th April 2010 23:17

Changing default .htaccess in stats folder
Does anyone know where I can find this default .htaccess file? I would like to add some things to the file so that my drupal sites can have access to the stats folders, and I just want it done on creation.


till 7th April 2010 11:00

The file is created from in the apache plugin. There is no template for it.

dclardy 7th April 2010 20:51

Thanks for the help Till.

Just in case any one else wants to add this automatically. It gives you access to the stats folder when Drupal is installed. It might work with other CMS as well.


DirectoryIndex index.php index.html index.htm
Options +Indexes


//* Create .htaccess and .htpasswd file for website statistics
                if(!is_file($data["new"]["document_root"].'/web/stats/.htaccess') or $data["old"]["document_root"] != $data["new"]["document_root"]) {
                        if(!is_dir($data["new"]["document_root"].'/web/stats')) mkdir($data["new"]["document_root"].'/web/stats');
                        $ht_file = "DirectoryIndex index.php index.html index.htm\nOptions +Indexes\n\n\nAuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data["new"]["document_root"]."/.htpasswd_stats\nrequire valid-user";

It starts at line 818 and ends at 825. You can just copy and paste this in if you want you can look at the changes that I have made to it.

All times are GMT +2. The time now is 05:26.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.