diff -r -u webalizer-2.01.10-orig/output.c webalizer-2.01.10/output.c
--- webalizer-2.01.10-orig/output.c	2001-06-15 10:34:24.000000000 +0200
+++ webalizer-2.01.10/output.c	2002-09-18 15:44:26.000000000 +0200
@@ -2295,7 +2295,7 @@
 /* WRITE_MAIN_INDEX - main index.html file   */
 /*********************************************/
 
-int write_main_index()
+int write_main_index(int year)
 {
    /* create main index file */
 
@@ -2309,6 +2309,7 @@
    double  gt_visits=0.0;
    char    index_fname[256];
    char    buffer[BUFSIZE];
+   char    usage_fname[15]="usage.png";
 
    if (verbose>1) printf("%s\n",msg_gen_sum);
 
@@ -2327,7 +2328,12 @@
 
    i=(s_mth==12)?1:s_mth+1;
 
-   year_graph6x(   "usage.png",         /* filename          */
+   if (year)
+   {
+      snprintf(usage_fname, 15, "usage_%4.4d.png", year);
+   }
+
+   year_graph6x(   usage_fname,         /* filename          */
                    buffer,              /* graph title       */
                    i,                   /* last month        */
                    hist_hit,            /* data set 1        */
@@ -2338,7 +2344,14 @@
                    hist_visit);         /* data set 6        */
 
    /* now do html stuff... */
-   sprintf(index_fname,"index.%s",html_ext);
+   if (year)
+   {
+      snprintf(index_fname, 256, "index_%4.4d.%s",year,html_ext);
+   }
+   else
+   {
+      snprintf(index_fname, 256, "index.%s",html_ext);
+   }
 
    if ( (out_fp=fopen(index_fname,"w")) == NULL)
    {
@@ -2346,10 +2359,18 @@
       fprintf(stderr,"%s %s!\n",msg_no_open,index_fname);
       return 1;
    }
-   write_html_head(msg_main_per, out_fp);
+   if (year) {
+      char str[5];
+      snprintf(str, 5, "%4.4d", year);
+      write_html_head(str, out_fp);
+   }
+   else
+   {
+      write_html_head(msg_main_per, out_fp);
+   }
    /* year graph */
-   fprintf(out_fp,"<IMG SRC=\"usage.png\" ALT=\"%s\" "    \
-                  "HEIGHT=256 WIDTH=512><P>\n",buffer);
+   fprintf(out_fp,"<IMG SRC=\"%s\" ALT=\"%s\" "    \
+                  "HEIGHT=256 WIDTH=512><P>\n",usage_fname,buffer);
    /* month table */
    fprintf(out_fp,"<TABLE WIDTH=600 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
    fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
diff -r -u webalizer-2.01.10-orig/webalizer.c webalizer-2.01.10/webalizer.c
--- webalizer-2.01.10-orig/webalizer.c	2002-04-17 00:11:31.000000000 +0200
+++ webalizer-2.01.10/webalizer.c	2002-09-18 15:17:32.000000000 +0200
@@ -981,6 +981,12 @@
             t_visit=tot_visit(sm_htab);
             month_update_exit(req_tstamp);    /* process exit pages      */
             write_month_html();               /* generate HTML for month */
+	    /* check for year change */
+	    if (cur_year != rec_year)
+	    {
+	       /* if yes, do yearly stuff */
+	       write_main_index(cur_year);
+	    }
             clear_month();
             cur_month = rec_month;            /* update our flags        */
             cur_year  = rec_year;
@@ -1312,7 +1318,7 @@
          }
          month_update_exit(rec_tstamp);      /* calculate exit pages     */
          write_month_html();                 /* write monthly HTML file  */
-         write_main_index();                 /* write main HTML file     */
+         write_main_index(0);                /* write main HTML file     */
          put_history();                      /* write history            */
       }
 
