httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Costume 406 in PHP with available variants
Date Wed, 05 Mar 2008 15:53:02 GMT
On Wed, Mar 5, 2008 at 10:30 AM, Daniel Aleksandersen
<aleksandersen+apache.org@runbox.com> wrote:
> Hi,
>
>  Apache's default 406 Not Acceptable error page is somewhat…unfriendly to
>  the users. Especially in my case because I am creating a page for elderly
>  people in Norway, and an error showing "advanced computer‐English" is not
>  something I want to serve them.
>
>  What I want is to get the list of 'available variants' that Apache serves
>  the users (below) in PHP. Preferably in an Array so I can rewrite it to
>  be more user friendly instead of just a technical file list. The default
>  Apache 406 page is setup something like this:
>
>  "406 Not Acceptable
>  Available variants:
>  index.en.html, type text/html, language en
>  index.nb.html, type text/html, language nb"
>
>  Can the same be achieved in PHP?

I don't believe so. You can check the contents of the ERROR_NOTES and
REDIRECT_ERROR_NOTES environment variables, but I don't think they
contain all the information.

There is an alternative, however. You can use ForceLanguagePriority to
avoid the 406 page entirely. If you really want to provide a page of
different options, you would need to build that youself (by scanning
the filesystem in php) and then assign that page some arbitrary
(non-existent) language which you would list first in your
LanguagePriority directive.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message