tags:

views:

38

answers:

2

I'm using #!/bin/sh as my language.

A: 

I guess just call that like

myURL

because all CGI data will be in the environment variables (not sure about POST request though)

catwalk
+2  A: 

Doing a redirect would be easy. Just return the right HTTP header like:

Location: http://www.w3.org/pub/WWW/People.html

The problem is that the user will see the URL change in their browser.

Technically "forward" is a internal redirect which is normally supported by your "framework" (ie the Servlet API that you specified). I guess to get an "internal forward" to work in #!/bin/sh you would need to do something like this (psuedocode)

# before i've printed anything to the output
if "should i forward"
  my_other_cgi_page.sh
  exit
fi
mlathe