I'm not entirely clear about what you're asking for, but I think you want a request for a .htm page to transparently fire a cgi script which generates the page. You can set that up with Apache's mod_rewrite. In .htaccess put:
RewriteEngine on
RewriteBase /~quux/
RewriteRule ^page1\.htm$ a.cgi [T=application/x-httpd-cgi]
(Adapted from the
URL Rewriting Guide in the Apache manual.)
I can see that you might be asking about something entirely different, maybe something about displaying a link. If so, please clarify.