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"; |