6670fb5fcdb4479bcfb11971733ad9f9b41b895d
hiram
  Fri Jun 6 12:00:45 2025 -0700
correct URLs to hgdownload for chrom.sizes.txt and chromAlias.txt files refs #35870

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 758bf4db4b7..8df75c25832 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -11051,44 +11051,65 @@
         safef(aliasFile, sizeof aliasFile, "http%s://%s/goldenPath/%s/bigZips/%s.chromAlias.txt", cgiAppendSForHttps(), hDownloadsServer(), db, db);
         struct udcFile *file = udcFileMayOpen(aliasFile, udcDefaultDir());
 	if (file)
 	    {
 	    udcFileClose(&file);
 	    printf("<a href='%s' target=_blank>%s.chromAlias.txt</a>", aliasFile, db);
 	    }
 	else
 	    puts("&nbsp");
 	}
     }
 else if (hubAliasFile)
     {
     puts("Download the table below as a text file: ");
     if (chromSizesFile)
+	{
+        if (startsWith("/gbdb/genark/", chromSizesFile))
+	    {
+            char *stripped = cloneString(chromSizesFile);
+            stripString(stripped, "/gbdb/genark/");
+            printf("<a href='https://%s/hubs/%s' target=_blank>%s.chrom.sizes.txt</a>", hDownloadsServer(), stripped, trackHubSkipHubName(database));
+	    }
+	    else
 	    {
 	    printf("<a href='%s' target=_blank>%s.chrom.sizes.txt</a>", chromSizesFile, trackHubSkipHubName(database));
+	    }
         puts("&nbsp;&nbsp;");
 	}
     else
         puts("&nbsp");
-    char *aliasUrl = cloneString(hubAliasFile);
+
+    char *aliasUrl;
     /* this URL reference needs to be a text file to work as a click in the
      *    html page.  Both files chromAlias.bb and chromAlias.txt exist.
      */
     if (endsWith(hubAliasFile, "chromAlias.bb"))
        aliasUrl = replaceChars(hubAliasFile, "chromAlias.bb", "chromAlias.txt");
+    else
+        aliasUrl = cloneString(hubAliasFile);
+
+    if (startsWith("/gbdb/genark/", aliasUrl))
+	{
+	stripString(aliasUrl, "/gbdb/genark/");
+	printf("<a href='https://%s/hubs/%s' target=_blank>%s.chromAlias.txt</a>", hDownloadsServer(), aliasUrl, trackHubSkipHubName(database));
+	}
+	else
+	{
 	printf("<a href='%s' target=_blank>%s.chromAlias.txt</a>", aliasUrl, trackHubSkipHubName(database));
 	}
+    }
 puts("</p>");
 }
 
 void chromInfoPage()
 /* Show list of chromosomes (or scaffolds, etc) on which this db is based. */
 {
 boolean hasAlias = FALSE;
 char *chromSizesFile = NULL;
 char *aliasFile = NULL;
 if (trackHubDatabase(database))
     {	/* either one of these files present will work */
     aliasFile = trackHubAliasFile(database);
     if (aliasFile)
         {
             hasAlias = TRUE;