Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

multilanguage error document support

Post new topic   Reply to topic    Apache Forum Index -> Apache

View previous topic :: View next topic  
Author Message

Joined: 03 Oct 2017
Posts: 6
Location: fairbanks, alaska, usa

PostPosted: Wed 04 Oct '17 18:28    Post subject: multilanguage error document support Reply with quote

Apache/2.4.27 (Fedora) OpenSSL/1.1.0f-fips PHP/7.1.9

my domain name is a spanish word, so accordingly i want the default language on my server to be spanish, and error messages to be served in spanish if that is acceptable to the browser.

then, for example, english pages, uploaded with a ".en" extension, will be served instead of spanish if they exist on the server and the browser accepts english and not spanish

the following configuration file is included on my server's apache distribution


and the files below include the text of the error messages in all supported languages

[justina@colmena error]$ pwd
[justina@colmena error]$ ls
contact.html.var                     HTTP_METHOD_NOT_ALLOWED.html.var        HTTP_SERVICE_UNAVAILABLE.html.var
HTTP_BAD_GATEWAY.html.var            HTTP_NOT_FOUND.html.var                 HTTP_UNAUTHORIZED.html.var
HTTP_BAD_REQUEST.html.var            HTTP_NOT_IMPLEMENTED.html.var           HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
HTTP_GONE.html.var                   HTTP_REQUEST_ENTITY_TOO_LARGE.html.var  include
[justina@colmena error]$

however i cannot get the multi-language error document support configured correctly ---

i'd like pointers to a little more documentation or tutorials on this particular feature
Back to top

Joined: 03 Oct 2017
Posts: 6
Location: fairbanks, alaska, usa

PostPosted: Sat 07 Oct '17 3:27    Post subject: Reply with quote

more on this i was using google's seo tools -- yes i know they don't call it that (seo is a dirty word, but whatever, put yourself out there if you're going to have a web page) -- anyways google suggested something called "hreflang tags" -- a nice writeup on the whole concept https://moz.com/learn/seo/hreflang-tag

so i might have for example on one of my pages two alternate translations

<link rel="alternate" href="/las_abejas/" hreflang="es" />
<link rel="alternate" href="/the_bees/" hreflang="en" />

but i want to compare that to apache's native implementation if my server's default language were spanish, then ideally

or even

would be in spanish, and apache would either suggest in the http headers or simply serve at the requested url

for english-speaking visitors (whose browsers are not configured to accept spanish)

so for best seo really it would be nice to have both methods of lanugage suggestion working correctly... any thoughts?
Back to top

Joined: 15 Oct 2005
Posts: 2683
Location: Hilversum, NL, EU

PostPosted: Sat 07 Oct '17 13:34    Post subject: Reply with quote

Old, maybe useful info: https://httpd.apache.org/docs/2.0/misc/custom_errordocs.html

And Language directives at: https://httpd.apache.org/docs/trunk/mod/mod_negotiation.html
Back to top

Joined: 03 Oct 2017
Posts: 6
Location: fairbanks, alaska, usa

PostPosted: Mon 09 Oct '17 5:35    Post subject: Reply with quote

Steffen wrote:

wonderful. thank you. i think perhaps documentation lags behind development sometimes, but this second link you mentioned is up to date and covers the handling of the ".html.var" pages which were included as custom error docs in fedora's distribution of apache

i think my next tack is to get the mod_ language negotiation working for some of my normal pages, according to the official apache documentation, and when i become familiar with them, then i will tackle the custom error docs
Back to top

Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1