Feature #1119

Add $HTTP["language"] for config conditionals based on `Accept-Language'.

Added by petar over 3 years ago. Updated over 1 year ago.

Status:Fixed Start:
Priority:Normal Due date:
Assigned to:jan % Done:

100%

Category:core
Target version:1.4.22
Missing in 1.5.x:

Description

With the attached patch, one should be able to redirect clients based on their `Accept-Language' request-header. This is a good thing for cgi-less multilingual sites.

language.patch (3.3 KB) petar, 04/13/2007 07:05 pm

language.2.patch - readjusted for 1.4.19 -- petar (2.6 KB) Anonymous, 05/09/2008 03:33 pm

language.3.patch - language.2.patch wasn't uploaded properly -- petar (2.6 KB) Anonymous, 05/09/2008 03:35 pm

lang.diff - Accept-Language patch for lighttpd 1.4.20. -- petar (2.6 KB) Anonymous, 10/08/2008 12:25 pm

Associated revisions

Revision 2392
Added by stbuehler over 1 year ago

Added Language conditional (fixes #1119); patch by petar

History

Updated by darix over 3 years ago

i think this is most likely something for 1.5 not for 1.4. jan?:)

Updated by petar over 3 years ago

Just for the record: I applied the patch on a productive lighttpd-1.4.13, the language-related config-section looks something like..


$HTTP["host"] =~ "^www\.site\.net$" {
        $HTTP["language"] =~ "(de|it|hr)" {
                url.redirect = ( "^/$" => "http://www.site.net/%1/" )
        }
        else $HTTP["language"] =~ ".*" {
                url.redirect = ( "^/$" => "http://www.site.net/en/" )
        }
}

..and the whole thing works quite well.

Updated by Anonymous over 2 years ago

There is something wrong with the attachment viewer. Raw file downloads work, but the viewer just displays a part of the file.

-- petar

Updated by stbuehler almost 2 years ago

  • Target version changed from 1.4.20 to 1.4.21

Updated by icy over 1 year ago

  • Target version changed from 1.4.21 to 1.4.22
  • Patch available set to Yes

Updated by petar over 1 year ago

Just FYI: I'm carrying this patch since 1.4.18 (or even 1.4.16) and never had any problems.

Petar

Updated by icy over 1 year ago

petar wrote:

Just FYI: I'm carrying this patch since 1.4.18 (or even 1.4.16) and never had any problems.

Thanks for the heads up. I'll ask if we can have this included in .21 too because it is lingering around for such a long time now but I'm not sure if we will do that as we want to get .21 out really really soon.

Updated by stbuehler over 1 year ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2392.

Updated by petar over 1 year ago

Thank you!

Also available in: Atom