You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
553 B

  1. :80 {
  2. root /srv/www
  3. locale en-US zh-CN zh-TW pt-BR nl-NL fr-FR {
  4. detect header
  5. }
  6. redir 301 {
  7. if {path} match ^/$
  8. / /{>Detected-Locale}/
  9. }
  10. rewrite /en-US/ {
  11. regexp (.*)
  12. to /en-us/{1}
  13. }
  14. rewrite /zh-CN/ {
  15. regexp (.*)
  16. to /zh-cn/{1}
  17. }
  18. rewrite /zh-TW/ {
  19. regexp (.*)
  20. to /zh-tw/{1}
  21. }
  22. rewrite /pt-BR/ {
  23. regexp (.*)
  24. to /pt-br/{1}
  25. }
  26. rewrite /nl-NL/ {
  27. regexp (.*)
  28. to /nl-nl/{1}
  29. }
  30. rewrite /fr-FR/ {
  31. regexp (.*)
  32. to /fr-fr/{1}
  33. }
  34. header / Vary "Accept-Language"
  35. }