Redirecting a POST to GET

Due to a DNS change and an uncontrollable form, I was asked to redirect a form from one URI to another. The first attempt was using a redirect in an htaccess file, which failed because the variables being sent via the POST were lost… What to do?

A quick little Perl script with less than 10 lines of code took care of things. We just capture the variables, and convert the POST to a GET and then redirect the browser to the correct location, properly passing all variables in the query string.

And since Apache doesn’t really care what extension is used, as long as it’s defined, you can create script.asp which is really written in Perl running on Linux to redirect to script.asp on another server running Windows and IIS.