From: eldy <> Date: Sun, 23 Feb 2003 05:53:14 +0000 (+0000) Subject: - Better 404 errors management. URLs are always cleaned from their X-Git-Tag: AWSTATS_5_5_BETA~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecf995861e63bf1f9cd26d619d67120ff8f4ef52;p=thirdparty%2FAWStats.git - Better 404 errors management. URLs are always cleaned from their parameter to build list 404 not found URLs list (because parameters are not intersting as they can't have effect because page is not found). Referrer URLs list for 40 not fouond URLs are kept with parameters only if URLReferrerWithQuery is set to 1. This make this report more useful. --- diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt index 9f143c1e..6a31c6ac 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -11,6 +11,11 @@ Fixes: New features/improvments: - Added a screen size report. +- Better 404 errors management. URLs are always cleaned from their + parameter to build list 404 not found URLs list (because parameters are not + intersting as they can't have effect because page is not found). Referrer + URLs list for 40 not fouond URLs are kept with parameters only if + URLReferrerWithQuery is set to 1. This make this report more useful. Other/Documentation: - Updated documentation. diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index a768d107..50757007 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -73,8 +73,8 @@ $FoundNotPageList=$FoundValidHTTPCodes=$FoundValidSMTPCodes=0; use vars qw/ $DNSStaticCacheFile $DNSLastUpdateCacheFile -$Lang $LogScreenSizeUrl +$Lang $MaxRowsInHTMLOutput $BarImageVertical_v $BarImageVertical_u @@ -89,8 +89,8 @@ $BarImageHorizontal_k /; $DNSStaticCacheFile='dnscache.txt'; $DNSLastUpdateCacheFile='dnscachelastupdate.txt'; -$Lang='auto'; $LogScreenSizeUrl='logscreensizeurl'; +$Lang='auto'; $MaxRowsInHTMLOutput = 1000; $BarImageVertical_v = 'vv.png'; #$BarImageHorizontal_v = 'hv.png'; @@ -528,7 +528,10 @@ use vars qw/ @Message /; 'Sender EMail', 'Receiver EMail', 'Reported period', -'Extra/Marketing' +'Extra/Marketing', +'Screen sizes', +'Worm/Virus attacks', +'Add to favourites' ); @@ -1863,9 +1866,9 @@ sub Read_History_With_TmpUpdate { if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowFileTypesStats) || $HTMLOutput{'filetypes'}) { $SectionsToLoad{'filetypes'}=$order++; } if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowOSStats) || $HTMLOutput{'os'}) { $SectionsToLoad{'os'}=$order++; } if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowBrowsersStats) || $HTMLOutput{'browserdetail'}) { $SectionsToLoad{'browser'}=$order++; } - if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowScreenSizeStats)) { $SectionsToLoad{'screensize'}=$order++; } if ($UpdateStats || $MigrateStats || $HTMLOutput{'unknownos'}) { $SectionsToLoad{'unknownreferer'}=$order++; } if ($UpdateStats || $MigrateStats || $HTMLOutput{'unknownbrowser'}) { $SectionsToLoad{'unknownrefererbrowser'}=$order++; } + if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowScreenSizeStats)) { $SectionsToLoad{'screensize'}=$order++; } # Referers if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowOriginStats) || $HTMLOutput{'origin'}) { $SectionsToLoad{'origin'}=$order++; } if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowOriginStats) || $HTMLOutput{'refererse'}) { $SectionsToLoad{'sereferrals'}=$order++; } @@ -5270,7 +5273,14 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') { # Updat $_errors_h{$field[$pos_code]}++; $_errors_k{$field[$pos_code]}+=int($field[$pos_size]); foreach my $code (keys %TrapInfosForHTTPErrorCodes) { - if ($field[$pos_code] == $code) { $_sider404_h{$field[$pos_url]}++; $_referer404_h{$field[$pos_url]}=$field[$pos_referer]; } + if ($field[$pos_code] == $code) { + my $newurl=$field[$pos_url]; + $newurl =~ s/([$URLQuerySeparators])(.*)$//; + $_sider404_h{$newurl}++; + my $newreferer=$field[$pos_referer]; + if (! $URLReferrerWithQuery) { $newreferer =~ s/([$URLQuerySeparators])(.*)$//; } + $_referer404_h{$newurl}=$newreferer; + } } next; }