Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/web/templates/site.conf.erb

Issue 29537689: #3299 - Add URI redirect for missing translations (Closed) Base URL: https://hg1/infrastructure
Patch Set: Created Sept. 6, 2017, 10:54 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/web/templates/site.conf.erb
===================================================================
--- a/modules/web/templates/site.conf.erb
+++ b/modules/web/templates/site.conf.erb
@@ -54,6 +54,22 @@
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])(/.+) {
+ if (!-e "$document_root$uri")
+ {
+ rewrite ^/([a-z][a-z])(/.+) $2 redirect;
+ }
+}
+
+# http://hub.eyeo.com/issues/3299 Redirect missing translations to default
+location ~ ^/([a-z][a-z]\_[A-Z][A-Z])(/.+) {
f.nicolaisen 2017/09/06 23:00:19 It would be cool if we could join both these locat
+ if (!-e "$document_root$uri")
+ {
+ rewrite ^/([a-z][a-z]\_[A-Z][A-Z])(/.+) $2 redirect;
f.nicolaisen 2017/09/06 23:00:19 Lots of duplication here :(
+ }
+}
+
<% if @multiplexer_locations %>
<% @multiplexer_locations.each do |location| %>
location <%= location %>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld