Page tree
Skip to end of metadata
Go to start of metadata

This document outlines the simple changes needed to migrate from the old download mirror system to the new one:

Using `` in your download .cgi script?

Change this to ``!

Using a .cgi with an accompanying .html file with the same name?

Great: you probably don't need to do anything! But check that the script works OK to make sure.

Note: the system relies on finding the .html file in the same directory as the .cgi file.
If your site uses redirects, that may break the linkage.
See below for details that may affect how the page displays.

Using `.htaccess` files that redirect or refer to a .cgi file?

You may need to make changes, as all `.cgi` files are now being internally rewritten.
The redirect of the `.cgi` file occurs before the `.htaccess` file is processed so the mirror system won't see any redirects applied by your `.htaccess` file to the `.cgi` file.

You can fix this by updating the links to .cgi files to point to the same parent directory as the redirected `.html` file.
The `.cgi` file does not actually have to be present at the target location.

However fixing ASF website pages won't fix existing links which may appear on 3rd party sites. The only way to fix these is to ensure that the HTML file is accessible at the same (un-redirected) URL as the `.cgi` file.

If the HTML redirect is to another directory in the same site, then a simple file link should suffice.

Alternatively you can create an HTML file in the original location; with a meta-redirect to the redirected location of the `.cgi` file (not the HTML file). The meta-redirect will be processed and the `.cgi` reference will again be intercepted; this time it is in the correct location.

For example, `` currently redirects to `commons/proper/commons-lang/`
This means that references to `/lang/download\_lang.cgi` no longer work properly.

Solution 1:

Create a link from `../proper/commons-lang/download\_lang.html` to `lang/download\_lang.html`

Solution 2:

Create the file `lang/download\_lang.html` with the content

<meta http-equiv="refresh" content="0; url=/proper/commons-lang/download_lang.cgi" />

If the .htaccess redirects change later, any such fixes may have to be updated.

Creating new download links?

You may want to adopt closer.lua or simply have an EZT template (see this Tomcat example or its source ) called `download.html` and then point to `download.cgi` to have our new system use your template via internal rewrites.

Using a custom CGI file for your downloads?

Please have a static EZT template (see example above) called `download.html` (or equivalent) and refer to it as `download.cgi` to have our mirror system pick up the template and use it. You can also call it `download-foo.html` and refer to it as `download-foo.cgi` to have it rendered via our mirror system.

Using SSI (Server-Side Includes) in your current download page?

This won't work any more. Please use a static html template (see above).

Still having trouble?

Contact us at or through Slack.

1 Comment

  1. Is it really necessary to change closer.cgi to closer.lua in download.cgi?

    Is it not the case that references to *.cgi are rewritten to *.lua?