@@ -116,7 +116,7 @@ RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/latest$ {{site.baseurl}}/docs/$1/latest/ [R
116116RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/latest/(.*)$ {{site.baseurl}}/docs/$1/{{site.latest_docs_version}}/$2 [L]
117117
118118# Redirect http to https
119- # From Cordova PMC Member raphinesse
119+ # From Cordova PMC Member raphinesse
120120# https://s.apache.org/An8s
121121
122122# If we receive a forwarded http request from a proxy...
@@ -129,6 +129,19 @@ RewriteCond %{HTTPS} !=on
129129# Redirect to https version
130130RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301 ]
131131
132- # Redirect all docs translations to their English version
133- RewriteCond $1 !=en
134- RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/(.*)$ {{site.baseurl}}/docs/en/$2 [R=302 ,L]
132+ # Prevent redirecting away from archive URLs
133+ RewriteCond %{REQUEST_URI} ^/archive/ [NC]
134+ RewriteRule .* - [L]
135+
136+ # Prevent redirecting away from English docs
137+ RewriteCond %{REQUEST_URI} ^/docs/en/ [NC]
138+ RewriteRule .* - [L]
139+
140+ # Redirect all non-English documentation to the English version.
141+ # If the English counterpart is missing, a 404 page will be displayed.
142+ # Over time, the non-English documentation has fallen out of sync with the English version.
143+ # For example, some pages may have been removed from the English documentation because they were no longer
144+ # relevant or were merged into other pages, while the translated versions were not updated accordingly.
145+ RewriteCond %{REQUEST_URI} ^/docs/(\w\w(?:-\w\w)?) [NC]
146+ RewriteCond %1 !=en
147+ RewriteRule ^docs/(\w\w(?:-\w\w)?)/(.*)$ /docs/en/$2 [R=302 ,L]
0 commit comments