Hi,
I'm running Zope on the same machine as Apache+PHP. I'm not trying to do anything clever - all I want to do is to redirect requests to http://www.spiderplant.net/dan/redirect.php (that was index.html but I've renamed it just for the mo) to http://www.spiderplant.net:8080/anticlimax/. To do this, I'm using the following code in redirect.php:
<?php header("Location: http://www.spiderplant.net:8080/anticlimax/index_html") ; ?>
Now, when I visit www.spiderplant.net/dan/redirect.php, the browser correctly redirects. However, none of the URLs generated in the index_html method have the port number in them; for example, this occurs:
<img src="http://www.spiderplant.net/anticlimax/titleImage" alt="Anticlimax Front Page Image" height="80" width="600" border="0" />
Notice the 8080 is missing from the hostname.
Why is this occurring? What's so special about doing a redirect *to* Zope that breaks it?
Feel free to visit the URLs above and see what I mean.
Yours confusedly, Dan
Just tested it with the excellent tcpwatch from Shane Hathaway. The problem lies not in zope, it's the browser (I use IE 5.00.dontaskme). First it goes to http://www.spiderplant.net/dan/redirect.php: ==> GET http://www.spiderplant.net/dan/redirect.php HTTP/1.0 ==> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* ==> Accept-Language: de ==> Accept-Encoding: gzip, deflate ==> User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; QXW03336) ==> Host: www.spiderplant.net ==> Proxy-Connection: Keep-Alive ==> [0.070 - Server connected] <== HTTP/1.1 302 Found <== Server: Apache/1.3.12 (Unix) PHP/4.0.4 mod_perl/1.24 mod_ssl/2.6.4 OpenSSL/0.9.5a <== X-Powered-By: PHP/4.0.4 <== Content-Type: text/html <== Date: Tue, 12 Jun 2001 20:36:40 GMT <== Location: http://www.spiderplant.net:8080/anticlimax/index_html <== Proxy-Connection: Keep-Alive <== <== owser bug <== [0.210000 - Closed by Client] (Does anybody now what "owser bug" above should mean? Is this a sign?) You see it gets the redirect (302) and this happens: ==> GET http://www.spiderplant.net:8080/anticlimax/index_html HTTP/1.0 ==> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* ==> Accept-Language: de ==> Accept-Encoding: gzip, deflate ==> User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; QXW03336) ==> Host: www.spiderplant.net ==> Proxy-Connection: Keep-Alive ==> [0.040 - Server connected] <== HTTP/1.0 200 OK <== Server: Zope/Zope 2.3.2 (binary release, python 1.5.2, linux2-x86) ZServer/1.1b1 <== Content-Type: text/html <== Date: Tue, 12 Jun 2001 20:36:40 GMT <== Content-Length: 1261 <== Proxy-Connection: Keep-Alive <== <== <html> <== <head> <== <!-- Don't complain the code is messy, auto generated code usually is. --> <== <title>Anticlimax</title> <== <link rel="stylesheet" type="text/css" href="http://www.spiderplant.net/anticlimax/stylesheet"> <== <== <script language="JavaScript" src="http://www.spiderplant.net/anticlimax/main/JavaScript/NewWindow.js"></script> <== [snip] ==> GET http://www.spiderplant.net/anticlimax/main/JavaScript/NewWindow.js HTTP/1.0 ==> Accept: */* ==> Referer: http://www.spiderplant.net:8080/anticlimax/index_html ==> Accept-Language: de ==> Accept-Encoding: gzip, deflate ==> User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; QXW03336) ==> Host: www.spiderplant.net ==> Proxy-Connection: Keep-Alive ==> <== </body></html>HTTP/1.1 404 Not Found <== Date: Tue, 12 Jun 2001 20:34:29 GMT <== Server: Apache/1.3.12 (Unix) PHP/4.0.4 mod_perl/1.24 mod_ssl/2.6.4 OpenSSL/0.9.5a <== Connection: close <== Content-Type: text/html; charset=iso-8859-1 <== <== <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <== <HTML><HEAD> <== <TITLE>404 Not Found</TITLE> <== </HEAD><BODY> <== <H1>Not Found</H1> <== The requested URL /anticlimax/main/JavaScript/NewWindow.js was not found on this server.<P> <== <HR> <== <ADDRESS>Apache/1.3.12 Server at www.spiderplant.net Port 80</ADDRESS> <== </BODY></HTML> If you look at the Host: header, you see www.spiderplanet.net. If I go directly to that URI, I get ==> GET http://www.spiderplant.net:8080/anticlimax/index_html HTTP/1.0 ==> Accept: */* ==> Accept-Language: de ==> Accept-Encoding: gzip, deflate ==> User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; QXW03336) ==> Host: www.spiderplant.net:8080 ==> Proxy-Connection: Keep-Alive ==> [0.140 - Server connected] <== HTTP/1.0 200 OK <== Server: Zope/Zope 2.3.2 (binary release, python 1.5.2, linux2-x86) ZServer/1.1b1 <== Content-Type: text/html <== Date: Tue, 12 Jun 2001 20:38:18 GMT <== Content-Length: 1286 <== Proxy-Connection: Keep-Alive [snip] Now the Host: header contains the correct portnumber. As I see it, zope does the right thing... Perhaps you should use proxying instead of a redirect. cheers, oliver
<snip>
[0.210000 - Closed by Client]
(Does anybody now what "owser bug" above should mean? Is this a sign?)
You see it gets the redirect (302) and this happens:
==> GET http://www.spiderplant.net:8080/anticlimax/index_html HTTP/1.0
==> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
==> Accept-Language: de
==> Accept-Encoding: gzip, deflate
==> User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; QXW03336)
==> Host: www.spiderplant.net
==> Proxy-Connection: Keep-Alive
Ah, I see - the redirect is happening correctly, but IE is not putting the port number into the Host: header. All is clear. IE bug - should've guessed :) Actually, is it a bug, strictly speaking? Time to have a look throught the rfc's...
Now the Host: header contains the correct portnumber.
As I see it, zope does the right thing... Perhaps you should use proxying instead of a redirect.
Thanks for the detective work, Oliver. Setting up proxying is a little OTT for a personal web site, so I'll just stick to my current frames trick, I think... Thanks for your help, Dan
participants (2)
-
Daniel Fairs -
Oliver Bleutgen