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, 11:44 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,24 @@
set $preferredLang en;
}
- if ($arg_a ~ ^(view|show)?$) {
- rewrite ^/(index\.html)?$ /$preferredLang/? redirect;
- rewrite ^/(\w\w(_\w\w)?)$ /$1/ redirect;
+ set $browser "firefox";
+ if ($http_user_agent ~ \bChrome/\d+) {
+ set $browser "chrome";
+ }
+ if ($http_user_agent ~ \bPresto/\d+) {
+ set $browser "opera";
+ }
+ if ($http_user_agent ~ \bAndroid\s.*\bAppleWebKit/\d+) {
+ set $browser "android";
}
- 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|android) /$1/#$3 permanent;
+ rewrite ^/(\w\w(_\w\w)?)/installation$ /$1/ permanent;
rewrite ^/anwiki/(.*) /$1 permanent;
if (-f $request_filename) {
@@ -31,16 +43,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