diff --git a/docs/RECOMMENDATIONS.md b/docs/RECOMMENDATIONS.md index 330fc66..6f0823e 100644 --- a/docs/RECOMMENDATIONS.md +++ b/docs/RECOMMENDATIONS.md @@ -281,3 +281,54 @@ Items з статусом `DONE`, `WONTFIX`, `DEFERRED` переходять у *Last update: 2026-05-01 (W1-W3 workflow + D1-D4 doc items added).* *Initial backlog: 2026-04-30 (gocc1+2+3+4 audits).* + +## D-canonical-archive — Canonical points to `/v/` instead of archive URL pattern (13 sites) + +**Зона:** Backend (admin/dev) — потребує kor reboot. + +**Symptom:** На archive routes (`/v/arch/`, `/v-cache/`, `/v/stored/`, etc. per CSV new-url-pattern) canonical link генерується як `/v//...` (standard) замість archive URL. Robots `noindex,follow` правильно set, але canonical не reflects archive. + +**Root cause:** `views/id_index.etlua` line ~90 hardcodes `/v/` у canonical generation. Frontend не має access до runtime URL (`ngx.var.uri` not accessible у etlua context, `mysettings.cur_uri` not set). + +**Reference (8161 has partial setup):** +- `var.archive_video_dir = "/v-arch/"` +- `var.canonical_without_archive = 1` — explicit strip → canonical = standard `/v/` (BY DESIGN для 8161) +- `app.lua` line 2408-2409 використовує `archive_video_dir` для URL formation + +**Fix per site (13 sites — крім 8161 яке by design strip):** + +```lua +-- lib//var.lua +var.archive_video_dir = "" -- e.g. "/v/arch/" для 8159 +var.canonical_without_archive = 0 -- canonical KEEPS archive prefix +var.nofollow_on_archive = 1 -- if not already +``` + +Per CSV `new-url-pattern` column: +| Port | new-url-pattern | +|------|-----------------| +| 8159 | /v/arch/ | +| 8163 | /v-cache/ | +| 8158 | /v/stored/ | +| 8151 | /v/old/ | +| 8160 | /v/storage/ | +| 8153 | /v/archive/ | +| 8154 | /v/unlisted/ | +| 8155 | /v/shelved/ | +| 8156 | /v/disabled/ | +| 8157 | /v/bin/ | +| 8162 | /v-storage/ | +| 8150 | /video/old/ | +| 8152 | /v/parked/ | + +Plus `subrouter.lua` route registration якщо missing — verify each site handles archive route. + +**Verify post-deploy:** +```bash +curl -sL "https://www.//" | grep -oE 'rel="canonical" href="[^"]+"' +# Expected: href="https://www.//" (canonical=archive URL) +``` + +**Frontend template** (`id_index.etlua`) можливо потребує adjustment коли backend exposes `mysettings.cur_archive_path` чи similar — depending on app.lua implementation. + +Reported 2026-05-05 by user audit на 8159 → bug confirmed на ВСІХ 13 sites with archive routing setup.