httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Derek Basch <>
Subject [users@httpd] CGI and HTTP Header Location redirects
Date Fri, 04 Feb 2005 00:27:19 GMT

I have been dealing with some strange behavior using CGI, python and an HTTP
Header "Location:" redirect on an Apache 1.3 server.

If I call a CGI script and perform a "Location:" redirect the script seems to
silently run off the tracks immediately after the redirect. For example "0.xml"
and "1.xml" are created when there is no redirect and only "0.xml" is created
when a redirect does occur (see below).

Also, after enabling suEXEC on the apache server the script executes perfectly
with the redirect. Can anyone explain this behavior? I would guess that it is
related to apache user rights but I can't find any reference to such problems
via Google.

Thanks everyone!,
Derek Basch


#! /usr/bin/python

import sys
import cgitb

class Trainer:
	def train(self):
		fs = open("/tmp/0.xml", "w")
##		print "Location: " + "" + "\n\n"
		fs = open("/tmp/1.xml", "w")

def main():
		trainer = Trainer()

	except Exception, inst:
if __name__ == '__main__':

Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message