From: eldy <>
Date: Mon, 21 Oct 2002 12:37:37 +0000 (+0000)
Subject: Added URLReferrerWithQuery parameter.
X-Git-Tag: AWSTATS_5_1_RELEASE~24
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=234dc3e24c9582ed02cbea8016eb84d32fc53567;p=thirdparty%2FAWStats.git
Added URLReferrerWithQuery parameter.
---
diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt
index 3e37f6e2..5404eb64 100644
--- a/docs/awstats_changelog.txt
+++ b/docs/awstats_changelog.txt
@@ -17,8 +17,10 @@ AWStats Changelog
- New parameter: Added URLNotCaseSensitive.
- New parameter: Added URLWithQueryWithoutFollowingParameters to exclude some
parameters from URL when URLWithQuery is on.
+- New parameter: Added URLReferrerWithquery.
- Added tag %Dw-n for LogFile parameter (replaced with the day number in week
but differs from %DW-n because start with 0).
+- Fixed: Log analyze is no more stopped if log file contains binary chars.
- Fixed: -debug option is allowed in migrate.
- Fixed: Wrong window was opened when clicking on flag link when
UseFramesWhenCGI was on.
diff --git a/docs/awstats_config.html b/docs/awstats_config.html
index 945e3a1a..6d9e2af3 100644
--- a/docs/awstats_config.html
+++ b/docs/awstats_config.html
@@ -83,6 +83,7 @@ when reading it), follow the example:
URLNotCaseSensitive
URLWithQuery
URLWithQueryWithoutFollowingParameters
+URLReferrerWithQuery
WarningMessages
NbOfLinesForCorruptedLog
SplitSearchString
@@ -762,7 +763,7 @@ when reading it), follow the example:
URLWithQuery
Version : 3.2 +
-
# Keep or attach the query string to the URL in the statistics for individual
+
# Keep or remove the query string to the URL in the statistics for individual
# pages. This is primarily used to differentiate between the URLs of dynamic
# pages. If set to 1, mypage.html?id=x and mypage.html?id=y are counted as two
# different pages.
@@ -798,6 +799,21 @@ when reading it), follow the example:
+URLReferrerWithQuery
+Version : 5.1 +
+
# Keep or remove the query string to the referrer URL in the statistics for
+
# external referrer pages. This is used to differentiate between the URLs of
+
# dynamic referrer pages. If set to 1, mypage.html?id=x and mypage.html?id=y
+
# are counted as two different referrer pages.
+
# Possible values:
+
# 0 - Referrer URLs are cleaned from the query string (ie: "/mypage.html")
+
# 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y")
+
# Default: 0
+
#
+
URLReferrerWithQuery=0
+
+
+
WarningMessages
Version : 1.0 +
# AWStats can detect setup problems or show you important informations to have
diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf
index f1d3c271..b1b17a7c 100644
--- a/wwwroot/cgi-bin/awstats.model.conf
+++ b/wwwroot/cgi-bin/awstats.model.conf
@@ -443,7 +443,7 @@ ValidHTTPCodes="200 304"
URLNotCaseSensitive=0
-# Keep or attach the query string to the URL in the statistics for individual
+# Keep or remove the query string to the URL in the statistics for individual
# pages. This is primarily used to differentiate between the URLs of dynamic
# pages. If set to 1, mypage.html?id=x and mypage.html?id=y are counted as two
# different pages.
@@ -475,6 +475,18 @@ URLWithQuery=0
URLWithQueryWithoutFollowingParameters=""
+# Keep or remove the query string to the referrer URL in the statistics for
+# external referrer pages. This is used to differentiate between the URLs of
+# dynamic referrer pages. If set to 1, mypage.html?id=x and mypage.html?id=y
+# are counted as two different referrer pages.
+# Possible values:
+# 0 - Referrer URLs are cleaned from the query string (ie: "/mypage.html")
+# 1 - Full URL with query string is used (ie: "/mypage.html?p=x&q=y")
+# Default: 0
+#
+URLReferrerWithQuery=0
+
+
# AWStats can detect setup problems or show you important informations to have
# a better use. Keep this to 1, except if AWStats says you can change it.
# Possible values: 0 or 1
diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl
index c759f191..7db4c147 100644
--- a/wwwroot/cgi-bin/awstats.pl
+++ b/wwwroot/cgi-bin/awstats.pl
@@ -110,7 +110,8 @@ $NbOfLinesShowsteps $NewLinePhase $NbOfLinesForCorruptedLog $PurgeLogFile
$ShowAuthenticatedUsers $ShowFileSizesStats
$ShowDropped $ShowCorrupted $ShowUnknownOrigin $ShowLinksToWhoIs
$ShowEMailSenders $ShowEMailReceivers
-$Expires $UpdateStats $MigrateStats $URLNotCaseSensitive $URLWithQuery $UseFramesWhenCGI $DecodeUA
+$Expires $UpdateStats $MigrateStats $URLNotCaseSensitive $URLWithQuery $URLReferrerWithQuery
+$UseFramesWhenCGI $DecodeUA
/;
($EnableLockForUpdate, $DNSLookup, $AllowAccessFromWebToAuthenticatedUsersOnly,
$BarHeight, $BarWidth, $CreateDirDataIfNotExists, $KeepBackupOfHistoricFiles, $MaxLengthOfURL,
@@ -123,8 +124,9 @@ $NbOfLinesShowsteps, $NewLinePhase, $NbOfLinesForCorruptedLog, $PurgeLogFile,
$ShowAuthenticatedUsers, $ShowFileSizesStats,
$ShowDropped, $ShowCorrupted, $ShowUnknownOrigin, $ShowLinksToWhoIs,
$ShowEMailSenders, $ShowEMailReceivers,
-$Expires, $UpdateStats, $MigrateStats, $URLNotCaseSensitive, $URLWithQuery, $UseFramesWhenCGI, $DecodeUA)=
-(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
+$Expires, $UpdateStats, $MigrateStats, $URLNotCaseSensitive, $URLWithQuery, $URLReferrerWithQuery,
+$UseFramesWhenCGI, $DecodeUA)=
+(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
use vars qw/
$AllowToUpdateStatsFromBrowser $ArchiveLogRecords $DetailedReportsOnNewWindows
$FirstDayOfWeek $KeyWordsNotSensitive $SaveDatabaseFilesWithPermissionsForEveryone
@@ -1111,16 +1113,17 @@ sub Parse_Config {
next;
}
if ($param =~ /^URLNotCaseSensitive$/) { $URLNotCaseSensitive=$value; next; }
- if ($param =~ /^URLWithQuery$/) { $URLWithQuery=$value; next; }
+ if ($param =~ /^URLWithQuery$/) { $URLWithQuery=$value; next; }
if ($param =~ /^URLWithQueryWithoutFollowingParameters$/) {
foreach my $elem (split(/\s+/,$value)) { push @URLWithQueryWithoutFollowingParameters,$elem; }
next;
}
- if ($param =~ /^WarningMessages/) { $WarningMessages=$value; next; }
- if ($param =~ /^NbOfLinesForCorruptedLog/) { $NbOfLinesForCorruptedLog=$value; next; }
- if ($param =~ /^Expires/) { $Expires=$value; next; }
- if ($param =~ /^WrapperScript/) { $WrapperScript=$value; next; }
- if ($param =~ /^DecodeUA/) { $DecodeUA=$value; next; }
+ if ($param =~ /^URLReferrerWithQuery$/) { $URLReferrerWithQuery=$value; next; }
+ if ($param =~ /^WarningMessages/) { $WarningMessages=$value; next; }
+ if ($param =~ /^NbOfLinesForCorruptedLog/) { $NbOfLinesForCorruptedLog=$value; next; }
+ if ($param =~ /^Expires/) { $Expires=$value; next; }
+ if ($param =~ /^WrapperScript/) { $WrapperScript=$value; next; }
+ if ($param =~ /^DecodeUA/) { $DecodeUA=$value; next; }
# Read optional accuracy setup section
if ($param =~ /^LevelForRobotsDetection/) { $LevelForRobotsDetection=$value; next; }
if ($param =~ /^LevelForBrowsersDetection/) { $LevelForBrowsersDetection=$value; next; }
@@ -1480,6 +1483,7 @@ sub Check_Config {
if (! $DefaultFile[0]) { $DefaultFile[0]="index.html"; }
if ($URLNotCaseSensitive !~ /[0-1]/) { $URLNotCaseSensitive=0; }
if ($URLWithQuery !~ /[0-1]/) { $URLWithQuery=0; }
+ if ($URLReferrerWithQuery !~ /[0-1]/) { $URLReferrerWithQuery=0; }
if ($WarningMessages !~ /[0-1]/) { $WarningMessages=1; }
if ($NbOfLinesForCorruptedLog !~ /^\d+/ || $NbOfLinesForCorruptedLog<1) { $NbOfLinesForCorruptedLog=50; }
if ($Expires !~ /^\d+/) { $Expires=0; }
@@ -5330,7 +5334,7 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat
$found=1;
}
else {
- # This hit came from the search engine
+ # This hit came from a search engine
if ($PageBool) { $_from_p[2]++; }
$_from_h[2]++;
$_se_referrals_h{$TmpRefererServer{$refererserver}}++;
@@ -5376,8 +5380,14 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat
if ($PageBool) { $_from_p[3]++; }
$_from_h[3]++;
# http://www.mysite.com/ must be same referer than http://www.mysite.com but .../mypage/ differs of .../mypage
- #if ($refurl[0] =~ /^[^\/]+\/$/) { $field[$pos_referer] =~ s/\/$//; } # Code moved in save
- $_pagesrefs_h{$field[$pos_referer]}++;
+ #if ($refurl[0] =~ /^[^\/]+\/$/) { $field[$pos_referer] =~ s/\/$//; } # Code moved in SaveHistory
+ if ($URLReferrerWithQuery) {
+ $_pagesrefs_h{$field[$pos_referer]}++;
+ }
+ else {
+ if ($field[$pos_referer]=~/^(.*)\?/) { $_pagesrefs_h{"$1"}++; }
+ else { $_pagesrefs_h{$field[$pos_referer]}++; }
+ }
$found=1;
}
}