Re: Costume 406 in PHP with available variants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 5, 2008 at 10:30 AM, Daniel Aleksandersen
<aleksandersen+apache.org@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux