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

Unified Diff: modules/adblockplusorg/files/adblockplus.org

Issue 9048063: infrastructure: Redirects for the new website (Closed)
Patch Set: Created Dec. 19, 2012, 10:27 a.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/adblockplusorg/files/adblockplus.org
===================================================================
--- a/modules/adblockplusorg/files/adblockplus.org
+++ b/modules/adblockplusorg/files/adblockplus.org
@@ -16,12 +16,23 @@
set $preferredLang en;
}
- if ($arg_a ~ ^(view|show)?$) {
- rewrite ^/(index\.html)?$ /$preferredLang/? redirect;
- rewrite ^/(\w\w(_\w\w)?)$ /$1/ redirect;
+ if ($http_user_agent ~ \bChrome/\d+) {
+ set $browser "chrome";
+ }
+ if ($http_user_agent ~ \bPresto/\d+) {
+ set $browser "opera";
+ }
+ if ($http_user_agent !~ \bChrome/\d+) {
Wladimir Palant 2012/12/19 11:16:39 Actually, it wasn't broken before - a rewrite stat
Felix Dahlke 2012/12/19 11:45:30 Right, didn't think there. I presumed this was jus
+ set $browser "firefox";
}
- rewrite ^/(\w\w)/installation$ /$1/ permanent;
+ if ($arg_a ~ ^(view|show)?$) {
+ rewrite ^/(index\.html)?$ /$preferredLang/#$browser redirect;
+ rewrite ^/(\w\w(_\w\w)?)$ /$1/#$browser redirect;
+ }
+
+ rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera) /$1/#$3 permanent;
Wladimir Palant 2012/12/19 11:16:39 Also android.
+ rewrite ^/(\w\w(_\w\w)?)/installation$ /$1/ permanent;
Felix Dahlke 2012/12/19 10:32:09 This one I did fix while I was at it.
Wladimir Palant 2012/12/19 11:16:39 Actually, I think that zh_CN was only added after
rewrite ^/anwiki/(.*) /$1 permanent;
if (-f $request_filename) {
@@ -31,16 +42,6 @@
break;
}
- if ($http_user_agent ~ \bChrome/\d+) {
- rewrite ^/(\w\w(_\w\w)?)/?$ /$1/chrome;
- }
- if ($http_user_agent ~ \bPresto/\d+) {
- rewrite ^/(\w\w(_\w\w)?)/?$ /$1/opera;
- }
- if ($http_user_agent !~ \bChrome/\d+) {
- rewrite ^/(\w\w(_\w\w)?)/?$ /$1/firefox;
- }
-
set $static "";
if (-f "$document_root/static$uri") {
set $static "ok";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld