Repository navigation
Send old ?locale=ru|zh page addresses to the page in that language - #409
Conversation
The search engines still hold the Rails site's ?locale= addresses: on 2026-10-08 Google had 110 of openipc.org's 671 URLs with impressions carrying a query string, and /cameras/vendors/sigmastar/socs/ssc30kq?locale=ru alone earned 35 clicks in four weeks. The bundle ignores the parameter, so those readers got the English page, and its canonical told the engine to keep the English one. Only the home page's script honoured it. The seam's `location /` in both vhosts now answers a GET or HEAD with ?locale=ru or ?locale=zh, on an address without a language of its own and not a file, with a 301 to /ru/... or /zh/..., keeping the rest of the query. It applies only where the route map says page or catchall; an address the map redirects or retires is answered by the map first, and the next hop localises. Built from $request_uri and $args, never the decoded $uri. Relative, so openipc.ru's mirror rewrites it as it does every other redirect. check-config.sh --seam covers the redirects, the query handling, and the cases that must not redirect.
PR Summary by QodoRedirect legacy locale query URLs to Russian and Chinese pages
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
Follow-up to #408, from a Google and Bing audit through their APIs.
Why
Google still ranks the Rails site's
?locale=addresses: 110 of the 671 openipc.org URLs with impressions (28 days to 2026-10-05) carry a query string, and/cameras/vendors/sigmastar/socs/ssc30kq?locale=rualone had 35 clicks. The bundle ignores the parameter, so a Russian reader got the English page, and URL inspection shows Google consolidating those addresses onto the English page ("Alternate page with proper canonical tag"). Only/handled it, in the home page's script.Change
conf.d/openipc-locale-param.conf:$openipc_locale_param_target, set for GET or HEAD with?locale=ru|zh, on an address with no/ruor/zhprefix and no dot, where the route map's action ispageorcatchall. Target:/ru…or/zh…, keeping the rest of the query. Built from$request_uriand$args, not the decoded$uri(no CRLF in Location).location /inorg.openipcandorg.openipc.dev:if (...) { return 301 ...; }beforetry_files./about?locale=zh→/community?locale=zh) are answered by the map first; the next hop localises.Tests
deploy/nginx/check-config.sh --seam(20 new cases, including what must not redirect:/ru/…,locale=en|de|RU, files, POST), andservice/run.sh test ./deploytest/..., both pass.Not in this PR (same audit)
Sitemap:line (Give each chip and vendor page its own title and description; name the sitemap in robots.txt #408) is how Google finds it until the owner submits it in the UI.SubmitFeed(status Pending).InIndexabout 8.8k is the old wall and?locale=URLs, held back by robots.txt and fading out.