diff --git a/.htaccess b/.htaccess
index 34194d237..e824912de 100755
--- a/.htaccess
+++ b/.htaccess
@@ -5,29 +5,56 @@ Options +ExecCGI +Includes +IncludesNOEXEC +SymLinksIfOwnerMatch -Indexes
# prevent folder listing
IndexIgnore *
-# secure htaccess file
-
- Order allow,deny
- Deny from all
-
+# Apache 2.4
+
+ # secure htaccess file
+
+ Require all denied
+
-# prevent access to PHP error log
-
- Order allow,deny
- Deny from all
- Satisfy all
-
+ # prevent access to PHP error log
+
+ Require all denied
+
-# prevent access to LICENSE
-
- Order allow,deny
- Deny from all
- Satisfy all
-
+ # prevent access to LICENSE
+
+ Require all denied
+
-# prevent access to csv and txt files
-
- Order allow,deny
- Deny from all
- Satisfy all
-
+ # prevent access to csv, txt and md files
+
+ Require all denied
+
+
+
+# Apache 2.2
+
+ # secure htaccess file
+
+ Order allow,deny
+ Deny from all
+ Satisfy all
+
+
+ # prevent access to PHP error log
+
+ Order allow,deny
+ Deny from all
+ Satisfy all
+
+
+ # prevent access to LICENSE
+
+ Order allow,deny
+ Deny from all
+ Satisfy all
+
+
+ # prevent access to csv, txt and md files
+
+ Order allow,deny
+ Deny from all
+ Satisfy all
+
+
diff --git a/application/hooks/db_log.php b/application/hooks/db_log.php
index 81445547c..04459d5d7 100644
--- a/application/hooks/db_log.php
+++ b/application/hooks/db_log.php
@@ -8,7 +8,7 @@ function db_log_queries()
if($CI->config->item('db_log_enabled'))
{
// Creating Query Log file with today's date in application/logs folder
- $filepath = APPPATH . 'logs/Query-log-' . date('Y-m-d') . '.log';
+ $filepath = APPPATH . 'logs/Query-log-' . date('Y-m-d') . '.php';
// Opening file with pointer at the end of the file
$handle = fopen($filepath, "a+");
diff --git a/public/.htaccess b/public/.htaccess
index ae98319b7..20aeda3d8 100644
--- a/public/.htaccess
+++ b/public/.htaccess
@@ -24,11 +24,36 @@ RewriteRule ^(.*)$ index.php?/$1 [L]
#Options All -Indexes
Options +ExecCGI +Includes +IncludesNOEXEC +SymLinksIfOwnerMatch -Indexes
-# secure htaccess file
-
- Order allow,deny
- Deny from all
-
+# prevent folder listing
+IndexIgnore *
+
+# Apache 2.4
+
+ # secure htaccess file
+
+ Require all denied
+
+ # prevent access to PHP error log
+
+ Require all denied
+
+
+
+# Apache 2.2
+
+ # secure htaccess file
+
+ Order allow,deny
+ Deny from all
+ Satisfy all
+
+ # prevent access to PHP error log
+
+ Order allow,deny
+ Deny from all
+ Satisfy all
+
+