Index: modules/web/templates/site.conf.erb |
=================================================================== |
--- a/modules/web/templates/site.conf.erb |
+++ b/modules/web/templates/site.conf.erb |
@@ -54,6 +54,23 @@ |
rewrite ^/(\w\w(_\w\w)?)/$ /$1/$index_page last; |
} |
+# http://hub.eyeo.com/issues/3299 Redirect missing translations to default |
+location ~ ^/([a-z][a-z]\_[A-Z][A-Z])(/.+) { |
+ if (!-e "$document_root$uri") |
+ { |
+ # if there is no /es_Mx/page, redirect to /es/page instead: |
+ rewrite ^/([a-z][a-z])\_([A-Z][A-Z])(/.+) /$1$3 redirect; |
+ } |
+} |
+ |
+location ~ ^/([a-z][a-z])(/.+) { |
+ if (!-e "$document_root$uri") |
+ { |
+ # if there is no /es/page, redirect to /page instead: |
+ rewrite ^/([a-z][a-z])(/.+) $2 redirect; |
+ } |
+} |
+ |
<% if @multiplexer_locations %> |
<% @multiplexer_locations.each do |location| %> |
location <%= location %> |