in reply to cgi code that opens a website

That's easy. Just read CGI and use its ->redirect method.