I have a simple form on my website which requires the person viewing the page to input their details. Once input they hit the "Go" button and are taken to another screen where they can download the program. At this point I would be sent an email containing their details. What is now happening quite frequently (due apparently to a temporary overload at my webhost) is that they see a "Page not found screen".
What I would prefer to happen is if the procedure fails then rather than the "Page not found screen" appearing the person viewing the site would see another screen with a button on which links directly to my download file. This way I would lose the personal details of the person but they could still download the program. I would much prefer this situation than them see a "Page not found screen" and perhaps dissapear forever.
I can't see a way of doing it direct from your script, as by the time the error page appears control has been passed from your script to the server.
However, .htaccess files can be placed in any directory and will apply only to that directory and any below it. Maybe you could set up a custom 404 page just for your cgi-bin, with the direct download link on it?