|
Convenient web based access to our favorite web design Usenet groups
|
 |
This is Interesting: Free Magazines for Graphics designers and webmasters
| Author |
| Thread |
 |
|
|
|
|
|
 |
 |
 |
Re: OT: 406 Response Error |
 |
|
 |
|
|
|
  08-22-04 - 12:25 AM
|
On Sat, 21 Aug 2004, Brian wrote:
> Set a different default language (en) for the directory that contains
> error documents, using another .htaccess file.
I have to say that I don't think that's the answer, sorry. The 406
dilemma will still be there when the visitor requests, for example,
language "nl" only.
The first part of this question is, should one be using a custom 406
page at all? Apache automatically produces a nice little menu of
available variants (along with its unpleasant error message text), and
the RFC says that the server *SHOULD* produce such a menu. But if you
create a custom 406 page, then you lose that automatically-generated
menu. Short of rebuilding the module, you can't substitute the error
report text with some text of your choice, without losing the
automatically-generated menu.
Therefore, it seems that any custom 406 page needs to re-create a menu
of available variants. Which is tedious and error-prone.
The alternative is to avoid a 406 situation developing, by arranging
for one of the variants to be returned even when nothing matches. And
one of the keys to being able to do that is not to specify a
DefaultLanguage at all.
And then nominate one of the variants to be the non-language-specific
variant, and that'll be the one which is returned when none of the
requester's language selections match. I say more about that in the
cited web page, and I can only emphasise the remark I made before:
look carefully at the documentation for DefaultLanguage, it might not
do what you assume it does.
If you only wanted to advertise the HTTP content language, rather than
also influencing the content negotiation in unintended ways, then
maybe what is wanted in the .htaccess is a "Header" directive - I
haven't looked into that in detail, though - I suppose it would be
e.g:
Header set Content-Language en-au
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
 |
Re: OT: 406 Response Error |
 |
|
 |
|
|
|
  08-22-04 - 04:15 AM
|
Alan J. Flavell wrote:
> Brian wrote:
>
>
> I have to say that I don't think that's the answer, sorry.
Apologies, I've used that technique to overcome other problems,
compeltely unrelated to 405, or indeed content negotiation.
> The 406 dilemma will still be there when the visitor requests, for
> example, language "nl" only.
I was only giving a quick solution to the double 406, assuming that the
op was experienced enough to work out the rest of it.
> Apache automatically produces a nice little menu of available
> variants (along with its unpleasant error message text), and the RFC
> says that the server *SHOULD* produce such a menu. But if you create
> a custom 406 page, then you lose that automatically-generated menu.
Right you are. In fact, you've jogged my memory: this why I've avoided
the whole mess. I'd rather not expose the novice user to a cryptic
message, and the alternative is to provide no such menu.
> I can only emphasise the remark I made before: look carefully at the
> documentation for DefaultLanguage, it might not do what you assume it
> does.
All good advice. I should have kept my mouth shut.
--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
|
|
 |
| All times are GMT. The time now is 03:26 PM. |
 |
|
|
|
|
|  |
|