CGI Redirect

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Tue May 1 23:05:19 EDT 2001


----- Original Message -----
From: "Ben Ocean" <zope at thewebsons.com>
Subject: Re[2]: CGI Redirect


<HACK HACK>
> Here's my code. Can you tell me where I'm going wrong? (Everything gets
> replaced like it should, it's just the aforementioned error.)
<HACK HACK>
> print "Location:http://bladechevy.com/"
<HACK HACK>

That's your problem.  You must have the space after the colon, like this,
and
you must also have the second newline:

print "Location: http://bladechevy.com\n"

(Outlook Express insists on making that http:... a link; please ignore
the underlining if you receive it that way).

Remove the Content-type line and correct the Location: header and you should
be in good shape.

BTW if error messages are causing you 500 errors, put this at the top of
your
Python script:

    import sys
    sys.stderr = sys.stdout
    print "Content-type: text/plain\n"

and you should be able to read the error messages.  Of course, you need to
comment out the 2nd and 3rd lines after fixing the error(s).








More information about the Python-list mailing list