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.
Code:
DirectoryIndex index.php index.html index.htm
Options +Indexes
Code:
//* 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";
file_put_contents($data["new"]["document_root"].'/web/stats/.htaccess',$ht_file);
chmod($data["new"]["document_root"].'/web/stats/.htaccess',0755);
unset($ht_file);
}
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.
Recent comments
16 hours 12 min ago
22 hours 53 min ago
1 day 2 hours ago
1 day 4 hours ago
1 day 12 hours ago
1 day 22 hours ago
1 day 23 hours ago
2 days 2 hours ago
2 days 7 hours ago
2 days 7 hours ago