Skip to content

Commit 8388ae7

Browse files
committed
Fixed a problem with apache rewrite rules wen noflag is selected.
Fixed: FS#934 - Webalizer statistics wrong
1 parent baeb2be commit 8388ae7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

server/cron_daily.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,15 @@ function setConfigVar( $filename, $varName, $varValue ) {
133133

134134
if(!@is_file($webalizer_conf)) {
135135
exec("cp $webalizer_conf_main $webalizer_conf");
136+
}
136137

138+
if(@is_file($webalizer_conf)) {
137139
setConfigVar($webalizer_conf, 'Incremental', 'yes');
138-
setConfigVar($webalizer_conf, 'IncrementalName', $logdir.'/webalizer.current');
139-
setConfigVar($webalizer_conf, 'HistoryName', $logdir.'/webalizer.hist');
140+
setConfigVar($webalizer_conf, 'IncrementalName', $statsdir.'/webalizer.current');
141+
setConfigVar($webalizer_conf, 'HistoryName', $statsdir.'/webalizer.hist');
140142
}
141143

144+
142145
if(!@is_dir($statsdir)) mkdir($statsdir);
143146
exec("$webalizer -c $webalizer_conf -n $domain -s $domain -r $domain -q -T -p -o $statsdir $logfile");
144147
}

server/plugins-available/apache2_plugin.inc.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ function update($event_name,$data) {
579579
$rewrite_rules = array();
580580
if($data["new"]["redirect_type"] != '') {
581581
if(substr($data["new"]["redirect_path"],-1) != '/') $data["new"]["redirect_path"] .= '/';
582+
if($data["new"]["redirect_type"] == 'no' && substr($data["new"]["redirect_path"],0,4) != 'http') {
583+
$data["new"]["redirect_path"] = $data["new"]["document_root"]."/web".realpath($data["new"]["redirect_path"]).'/';
584+
}
585+
582586
$rewrite_rules[] = array( 'rewrite_domain' => $data["new"]["domain"],
583587
'rewrite_type' => ($data["new"]["redirect_type"] == 'no')?'':'['.$data["new"]["redirect_type"].']',
584588
'rewrite_target' => $data["new"]["redirect_path"]);
@@ -626,6 +630,9 @@ function update($event_name,$data) {
626630
// Rewriting
627631
if($alias["redirect_type"] != '') {
628632
if(substr($data["new"]["redirect_path"],-1) != '/') $data["new"]["redirect_path"] .= '/';
633+
if($data["new"]["redirect_type"] == 'no' && substr($data["new"]["redirect_path"],0,4) != 'http') {
634+
$data["new"]["redirect_path"] = $data["new"]["document_root"]."/web".realpath($data["new"]["redirect_path"]).'/';
635+
}
629636
$rewrite_rules[] = array( 'rewrite_domain' => $alias["domain"],
630637
'rewrite_type' => ($alias["redirect_type"] == 'no')?'':'['.$alias["redirect_type"].']',
631638
'rewrite_target' => $alias["redirect_path"]);

0 commit comments

Comments
 (0)