> def notfound():
> dt=datetime.datetime.now()
> event="notfound"
> env = web.ctx['environ']
> HTTP_REFERER = env['HTTP_REFERER']
> PATH_INFO = env['PATH_INFO']
>
> redirect = replace_relative_href_link(PATH_INFO)
> rr = '/class_notfound?' + redirect
> raise web.seeother(rr)
>
> class class_notfound:
> def GET(self):
> web.header("Content-Type","text/html; charset=utf-8")
> pqs = parse_query_string(web.ctx.query)
>
> for i,j in pqs.iteritems():
> redirect_url = mirror_url + '?redirect=' + j
> print redirect_url
>
> add = ""
> for i in xrange(500):
> add = add + '-'
>
> html = """
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
> Transitional//EN">
> <html>
> <title></title>
>
> <meta http-equiv="REFRESH" content="0;url=%s"></HEAD>
> <BODY>
> %s
> </BODY>
> </HTML>
>
> """ % (redirect_url,add)
> return html
Correct response is:
HTTP/1.1 404 Not Found
Content-type: text/html; charset=UTF-8
(HTML message)
Verify that this is the format of the response to a request being made
by Internet Explorer to a non-existent resource, using a packet
sniffer (for example).
If indeed this is what you are telling IE, then it is IE's problem
that it cannot correctly understand a 404 error message. This is what
I suspect, since as you say the code works without flaw in Mozilla and
Safari. Chances are this is Microsoft failing to read RFCs and is no
fault of your own. If you really wish to give a response to this
condition, then for Internet Explorer clients, you should return, as I
think you wanted to in the beginning,
HTTP/1.1 200 OK
Content-type: text/html; charset=UTF-8
(404 Message)
Which will make IE think the message is a normal response (and hence
it will not to whatever mangling it is currently doing and correctly
display your message). Anyone who uses IE won't be able to tell the
difference; just send this code out when the USER-AGENT is reported as
Internet Explorer of any kind.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---