Project

General

Profile

Feature #1119

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

Added by petar over 9 years ago. Updated about 1 month ago.

Status:
Obsolete
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

100%

Missing in 1.5.x:
Yes

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 View (3.3 KB) petar, 2007-04-13 19:05

language.2.patch View - readjusted for 1.4.19 -- petar (2.62 KB) Anonymous, 2008-05-09 15:33

language.3.patch View - language.2.patch wasn't uploaded properly -- petar (2.62 KB) Anonymous, 2008-05-09 15:35

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

Associated revisions

Revision 2392 (diff)
Added by stbuehler over 7 years ago

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

Revision 066b208b (diff)
Added by stbuehler over 7 years ago

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2392 152afb58-edef-0310-8abb-c4023f1b3aa9

History

#1 Updated by darix over 9 years ago

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

#2 Updated by petar over 9 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.

#3 Updated by Anonymous over 8 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

#4 Updated by stbuehler almost 8 years ago

  • Target version changed from 1.4.20 to 1.4.21

#5 Updated by icy over 7 years ago

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

#6 Updated by petar over 7 years ago

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

Petar

#7 Updated by icy over 7 years 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.

#8 Updated by stbuehler over 7 years ago

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

Applied in changeset r2392.

#9 Updated by petar over 7 years ago

Thank you!

#10 Updated by a3nm almost 4 years ago

  • Status changed from Fixed to Reopened
  • Target version changed from 1.4.22 to 1.5.0

Not sure at all if this is the right way to complain about this (apologies if it isn't), but this useful feature has apparently not been ported to the 1.5x branch. Is it possible/desirable to do so?

Thanks!

#11 Updated by gstrauss about 2 months ago

  • Assignee deleted (jan)
  • Missing in 1.5.x set to Yes

FYI: patch was applied in lighttpd 1.4.x a long time ago

#12 Updated by gstrauss about 1 month ago

  • Status changed from Reopened to Obsolete

Also available in: Atom