I'm not having any luck getting ErrorDocument to work. I tried a very simple
ErrorDocument 404 "oops"
and restarted the server, but I still get the normal page not found. My
server is 1.3.17 running on AIX and the browser was IE5.5
Any suggestions would be appreciated.
Thanks
--
Jack Gostl go...@argoscomp.com
> I'm not having any luck getting ErrorDocument to work. I tried a very simple
> ErrorDocument 404 "oops"
> and restarted the server, but I still get the normal page not found. My
> server is 1.3.17 running on AIX and the browser was IE5.5
IE is useless, don't use it if you can get away with it. It wont actually
show your custom 404 page unless it's at least a certain length (think it
was 1k but I can't remember, search deja .. oh no, search google now instead
but google have pretty much totally ruined deja now. Sorry, tangent, they just
pissed me off by releasing it all totally unready for use) so yes, either make
your ErrorDoc 404 longer or use a different browser to see it. IE just causes
problems.
--
steven
1;
Ah, the tragic irony. The simple 404 response, kept simple to eliminate
problems and make debugging more straightforward, bit you in the rear.
Internet Explorer will not display a 404 message that is shorter than 512
bytes (instead it substitutes its own utterly information-free and useless
message).
miguel
I use this technique on http://localmusicbuzz.com . If a url isn't
recognized, the error page checks a database of bands, and forwards you to
the one with the name most similar to the URI.
--
.Richard Fairthorne
.Technical Director, Alavator Corporation
.ph (416) 996-3663.fax (416) 996-0213
"steven" <ste...@ircnet.dk> wrote in message
news:nydi6.149$9S.1...@news.get2net.dk...
Yep, but sending a 200 response just so a buggy browser will work properly
to me isn't right, better to do things the right way regardless and let MS
fix their poor code.
--
steven
1;
> Another solution is to write an asis server document, or have a php script
> that spits out a 200 OK header so that IE doesn't know it's seing an error
> document.
Telling lies to the client isn't a very productive way of proceeding.
> I use this technique on http://localmusicbuzz.com . If a url isn't
> recognized, the error page checks a database of bands, and forwards you to
> the one with the name most similar to the URI.
There's a 30x code for that precise purpose.
Oh look, an upside-down quoter. It fits.
> .Technical Director, Alavator Corporation
Hmmm. Let's hope the non-technical staff have a better grasp of WWW
engineering principles.
I know you won't wish to know this, but after a considerable wait:
[LINK] [INLINE] [INLINE]
[INLINE] [INLINE]
[INLINE] [INLINE]
[INLINE] [INLINE]
[INLINE] [INLINE]
[INLINE] [INLINE]
--
Argh, a good way polluting any proxies on the way, because they think
the request was a success.
...max
P.S.: This hint( or that what forces someone to think it愀 a solution)
and the fullquote at the end of the posting -> seems to be time for a
crusade against MS (sad and ironic).
Sanjay
Let me address you all, one at a time:
Max Dittrich said...
> Argh, a good way polluting any proxies on the way, because they think
> the request was a success.
Nonsense. The document is dynamically generated based on the url not-found.
Anything a proxy caches in this circumstance is useful data, *AND* the proxy
lifetime is set to be short for these pages because they are dynamically
generated.
Alan Flavel said:
> There's a 30x code for that precise purpose.
Sure.. a 302 would be appropriate in the case of a temporary redirect, and a
200 would then only be used when the server produces a list of matching
pages.. *BUT* a 302 with an Expires header pollutes proxies to the exact
same degree as a 200 with an Expires header, AND the client is forced to
check with the proxy every time, eating up internet bandwidth and slowing
response times.
A 30x code is a bad idea. But thanks for the ill suggestion.
Alan also said:
> I know you won't wish to know this, but after a considerable wait:
> [LINK] [INLINE] [INLINE]
> [INLINE] [INLINE]
Listen.. I like lynx as well, but I'd have to be an utter moron to try and
use a streaming media site with it. Besides, what you think of me personally
is irrelevant to the fact that I have a solution for the 404 problem and you
don't.
Steven said:
> Yep, but sending a 200 response just so a buggy browser will work properly
> to me isn't right, better to do things the right way regardless and let MS
> fix their poor code.
Now I agree with the sentiment behind this comment -- but "It's not my
fault, it's Microsofts's fault" isn't a good excuse for why your web page
isn't working. Apache's documentation includes information on how to
workaround MS bugs. I suggest you start by chastising the authors.
Thank you all for your advice/beligerance/flames/general-useless-info. If
someone wants to know how not to get their app working, I'm sure they'll
know exactly where to go.
What's next? Are you all going to criticize my spelling?
</rant>
I should also have pointed out that in the event that the page is static, it
can include proxy directives. The question wasn't about proxy control, it
was about generating an error page that can be displayed in the worlds most
popular browser. MSIE.
Do I advocate the browser's blatent disregard for the HTTP protocol? Of
course not. I simply live with it.
All the bluster aside, it strikes me as far more sensible - if you've
decided to try to work around the MSIE bug - to just send 511 spaces after
the end of your properly-headed 404 than to mislabel it as 200. No point
robbing people and their machines of potentially useful information (namely,
that it was not a valid URL) if you don't have to. Think of the poor search
engines.
miguel
Yeah.. I agree.. If you're returning a static page, that is the best
solution.
> <rant>
> No. You're all wrong.
OK, I've got the message, but somebody might still be interested in an
answer.
> Alan Flavel said:
[in reference to a multiple choices response]
> > There's a 30x code for that precise purpose.
>
> Sure.. a 302 would be appropriate in the case of a temporary redirect,
I'm sorry, I thought from the context it was obvious which response I
was referring to.
> 200 would then only be used when the server produces a list of matching
> pages..
As I said, there's a 30x code for that (300 Multiple choices).
> *BUT* a 302 with an Expires header pollutes proxies to the exact
> same degree as a 200 with an Expires header,
I'm not really interested in finding excuses for doing the wrong
thing, when the protocol tells me the right thing to do and there's no
compelling reason to do otherwise.
> AND the client is forced to check with the proxy every time,
Make up your mind. Either the result is cacheable or it isn't.
You send the appropriate headers accordingly.
eating up internet bandwidth and slowing
> response times.
> A 30x code is a bad idea. But thanks for the ill suggestion.
As I say, I've got the message. I won't be bothering you again.
> Listen.. I like lynx as well, but I'd have to be an utter moron to try and
> use a streaming media site with it.
So you don't know how to associate helper apps, I guess.
No it was quoted as opposed to a path to a file.
--
steven
1;
Trying 207.61.36.207...
Connected to localmusicbuzz.com.
Escape character is '^]'.
GET /quirx HTTP/1.1
Host: localmusicbuzz.com
Connection: close
HTTP/1.1 200 OK
Date: Thu, 15 Feb 2001 17:13:17 GMT
Server: Apache/1.3.17 (Unix) PHP/4.0.4pl1
X-Powered-By: PHP/4.0.4pl1
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
Did you changed anything on your solution dealing with 404s you
described here ? If not you are not telling the truth
> Anything a proxy caches in this circumstance is useful data, *AND* the proxy
> lifetime is set to be short for these pages because they are dynamically
> generated.
There aren´t any header that a proxy can make guesses on the freshness
of the document. No Last-modified, Exprires, Cache-Control and nothing.
See what a wrong typo returns:
Trying 207.61.36.207...
Connected to localmusicbuzz.com.
Escape character is '^]'.
H
> ^ i just send an 'H\n'
<br>
<b>Warning</b>: Failed opening 'includes/.conf' for inclusion
(include_path='') in
<b>/home/httpd/html/web1/audioearth/html/includes/common.inc</b> on line
<b>3</b><br>
unable to select database
Connection closed by foreign host.
Seems for me that you are working in a "No-errors"-company. Are you
afraid of presenting any 4xx or 5xx responses to you clients ?
And ...
[-8<--], better I cut this out.*[-8<--]
EOT,
...max
> > *BUT* a 302 with an Expires header pollutes proxies to the exact
> > same degree as a 200 with an Expires header,
>
> I'm not really interested in finding excuses for doing the wrong
> thing, when the protocol tells me the right thing to do and there's no
> compelling reason to do otherwise.
Ok.. this is now coming down to a matter of what I believe to be opinion.
Here's why.
QUOTE from HTTP/1.1 Docs:
> 10.3.1 300 Multiple Choices
> The requested resource corresponds to any one of a set of representations,
each with its own
> specific location, and agent- driven negotiation information
It is not clear to me what is meant by a representation, but my
interpretation is that it applies to a single set of data which can be
represented in many different formats(ie: english, french, german..
ASCII,braille encoding,WAP... PDF,HTML,Illustrator).
In *my* specific example, this is not the case. When the user reaches the
site, they have successfully reached (via entering an advertised URL) a page
which has links to other valid pages. To me, this is directly akin to
reaching a static page, and I feel that the 200 code is most appropriate for
this.
The mechanism by which they reached the page is not really an error. By
telling my server to redirect 404's to my database driven page, I'm really
adding an additional way for the server to find pages.. the request ISN'T a
404 from my perspective, because the client entered a URL, and found the
resource they were looking for!
From a different angle, any web page which contains links qualifies for a
multiple-choices protocol response. I don't think you're wrong to suggest
the header, but I also don't think it's practical for a web designer to
always pay this level of attention to what header he returns.
I cut the rest of the message.. your point on lynx is a good one, but I
genuinely believe that there are applications it was not designed for.
Again, if localmusicbuzz.com was a commercial project that I was getting
paid for, I might have paid more attention to these specifics.
Either way, I think you're an intelligent guy..and I apologize for my rant.
I tend to get edgy when I feel my character or expertise is being
attacked -- specially since I've been doing this stuff since the web was
invented. I don't claim, however, to always be right.. your suggestions may
be useful to me in the future.
> > AND the client is forced to check with the proxy every time,
>
> Make up your mind. Either the result is cacheable or it isn't.
> You send the appropriate headers accordingly.
This was in reference to the 302.
> 10.3.3 302 Found
> The requested resource resides temporarily under a different URI. Since
the redirection
> might be altered on occasion, the client SHOULD continue to use the
Request-URI for
> future requests. This response is only cacheable if indicated by a
Cache-Control or Expires
> header field
You are absolutely right. I can override the default behavior of a 302 by
using cache control directives, but[...]
> 10.2.1 200 OK
> The request has succeeded.
I don't feel that this response is incorrect either, and then it remains the
responsibility of the system administrator to maintain the cache
directives -- he has more data than the web-programmer by which he can do
this effectively.
Again, I'm not dissagreeing with your correctness, but I think there is some
room for interpretation without breaking the protocol.
> Did you changed anything on your solution dealing with 404s you
> described here ? If not you are not telling the truth
This is known as a bug. I do make mistakes.. In the event of a not-found
band, or url, the server is supposed to return a 404 with a redirect to the
front page. My bad.
> See what a wrong typo returns:
>
> Trying 207.61.36.207...
> Connected to localmusicbuzz.com.
> Escape character is '^]'.
> H
> > ^ i just send an 'H\n'
> <br>
> <b>Warning</b>: Failed opening 'includes/.conf' for inclusion
> (include_path='') in
> <b>/home/httpd/html/web1/audioearth/html/includes/common.inc</b> on line
> <b>3</b><br>
> unable to select database
> Connection closed by foreign host.
My FTP server probably doesn't handle it well if you connect and send an
SMTP request. The client that actually sends this request wouldn't have
understood an error code, because it's not an HTTP client.
You didn't send an HTTP request. What you are complaining about here is
apache's default mechanism for handling a mangled request, and that is
something I have no immediate control over. (in fact, the code you're
looking at isn't even from localmusicbuzz.com!) You should probably report
this to the apache development team, or submit a patch.
I don't think it's that big a deal, however, since the response itsn't
cachable. It's not even an HTTP response. On the other hand, it sure is
wasting a lot of CPU cycles trying to open a database each time this
happens.
But if we start getting a lot of people browsing using hand-typed http
requests, I'll submit the bug for you.
That's right.. anything starting with " should be treated as a text response
according to the apache documentation.
In that case, Apache just tries to return the default document for the
default server. The stuff that came back does come the content area of one
of your virtual servers.
This may also be what people see if they connect with clients that don't
send Host: headers.
miguel
I think I figured it out.. It's a named virtual server, and since none of
the names match, it seems to be serving up a document from the first virtual
server on that IP. So I added this new virtualhost:
<VirtualHost 207.61.36.207>
ServerAdmin ric...@alavator.com
DocumentRoot /usr/local/apache/htdocs
ServerName serverwithnousefulpurpose.kronk.bung
</VirtualHost>
This is more useful (and less CPU intensive) than a database driven web-page
which doesn't work when called with a bad hostname, but it would be nice to
just return an error code.
As for the HTTP 1.0 and earlier clients that don't support named V-hosts,
they'll all be obsolete soon, because of the Arin IP conservation
guidelines.
--
.Richard Fairthorne
.Technical Director, Alavator Corporation
.ph (416) 996-3663.fax (416) 996-0213
"Miguel Cruz" <m...@admin.u.nu> wrote in message
news:4h_i6.144$pS4.1...@typhoon2.ba-dsg.net...
? That was a requets to port 80 !
>
> You didn't send an HTTP request. What you are complaining about here is
> apache's default mechanism for handling a mangled request, and that is
> something I have no immediate control over. (in fact, the code you're
> looking at isn't even from localmusicbuzz.com!) You should probably report
> this to the apache development team, or submit a patch.
Hmm there is somebody who has control over handling mangled requests and
it愀 not your apache. I don愒 know how (Action ?), but it seems that all
requests are handled by somebody else than the apache-default-handler.
The Response of an "normal" (nothing and nobody is so) is something
like:
Connected to slashdot.org.
Escape character is '^]'.
H
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>501 Method Not Implemented</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
H to /index.shtml not supported.<P>
Invalid method in request H<P>
<HR>
<ADDRESS>Apache/1.3.12 Server at slashdot.org Port 80</ADDRESS>
</BODY></HTML>
>
> I don't think it's that big a deal, however, since the response itsn't
> cachable. It's not even an HTTP response. On the other hand, it sure is
> wasting a lot of CPU cycles trying to open a database each time this
> happens.
When driving home, I was in fear wether this is exploitable and I was
posting it around. I hope you can be sure that there is nothing of the
input I made, be interpreted by a php-script .
...max
--
.Richard Fairthorne
.Technical Director, Alavator Corporation
.ph (416) 996-3663.fax (416) 996-0213
"Max Dittrich" <Ditt...@zrz.TU-Berlin.de> wrote in message
news:3A8D2629...@zrz.TU-Berlin.de...