1954c1095a389ec259e7754dfe9dc5bf98cfba41
max
  Tue Aug 26 05:43:37 2025 -0700
adding api redirect rules to mirror docs, refs #36269

diff --git src/product/mirrorManual.txt src/product/mirrorManual.txt
index 9c782fd8c28..c6fd7daac26 100644
--- src/product/mirrorManual.txt
+++ src/product/mirrorManual.txt
@@ -1937,15 +1937,51 @@
 By default, your browser mirror only comes with our public hubs. You may want
 to remove these and replace them with the hubs in your institution. One idea
 could be to have one hub per research group or department and users connect to them on
 My Data > Track Hubs.
 
 Use hubPublicCheck to create the SQL command to add the hub:
 
     hubPublicCheck hubPublic -addHub=https://genome.ucsc.edu/goldenPath/help/examples/hubDirectory/hub.txt
 
 Output is:
 
     insert into hubPublic (hubUrl,descriptionUrl,shortLabel,longLabel,registrationTime,dbCount,dbList) values ("https://genome.ucsc.edu/goldenPath/help/examples/hubDirectory/hub.txt","", "My Hub's Name", "Name up to 80 characters versus shortLabel limited to 17 characters", now(),1, "hg19,"); 
 
 Then we run hubCrawl to get the searches to work (most mirrors do not need this). See <https://genomewiki.ucsc.edu/genecats/index.php/Public_Hub_QA> for more details.
 
+# Make the API work in the same way as on the public website
+
+The API is served by the hubApi program, but an Apache rule in httpd.conf allows shorter URLs to be used for API queries.
+The virtual host definition looks as follows on our server:
+
+    <VirtualHost *:443>
+    ServerName api.genome.ucsc.edu
+    ServerAlias api
+    ScriptAlias /cgi-bin/ "/data/apache/cgi-bin/" 
+    DocumentRoot "/data/apache/htdocs" 
+    RewriteEngine on
+    RewriteOptions Inherit
+    # The next four rewrite rules added by Hiram's request 05/01/2019
+    RewriteRule "^/list/(.*)$" "/cgi-bin/hubApi/list/$1" [L,PT]
+    RewriteRule "^/getData/(.*)$" "/cgi-bin/hubApi/getData/$1" [L,PT]
+    RewriteRule "^/findGenome(.*)$" "/cgi-bin/hubApi/findGenome$1" [L,PT]
+    RewriteRule "^/search$" "/cgi-bin/hubApi/search?%{QUERY_STRING}" [L,PT]
+    RewriteRule "^/cgi-bin/hubApi(.*)$" "/cgi-bin/hubApi$1" [L,PT]
+    RewriteRule "^(.*)$" "http://genome.ucsc.edu/goldenPath/help/api.html" [L]
+    AllowEncodedSlashes NoDecode
+    <Directory "/usr/local/apache/htdocs">
+       SSILegacyExprParser on
+       Options Indexes FollowSymLinks MultiViews Includes
+       AllowOverride None
+       Require all granted
+    </Directory>
+    AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript application/x-javascript application/json application/javascript
+    SSLEngine on
+    SSLProtocol all -SSLv2 -SSLv3
+    SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA
+    SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
+    SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
+    SSLCertificateChainFile /etc/httpd/conf/ssl.crt/chain.crt
+    Header set Access-Control-Allow-Origin "*" 
+    Header set Access-Control-Allow-Headers "Range" 
+    </VirtualHost>