diff --git a/server/static.ts b/server/static.ts index 06410ca..35f28b3 100644 --- a/server/static.ts +++ b/server/static.ts @@ -300,6 +300,35 @@ export function serveStatic(app: Express) { } } + // 29. 8. 2026: rubrike Aktuelles so preseljene na loceno stran news.folx.tv. + // Clanki ostanejo v bazi in v /api/articles (bere jih news.folx.tv in TV sidebar), + // na folx.tv pa se naslovi trajno preusmerijo. + const NEWS_HOST = "https://news.folx.tv"; + const NEWS_RUBRIK_SLUG: Record = { + "Politik": "politik", + "Promis": "promis", + "Sport": "sport", + "Musik & Film": "musik-film", + "Wetter": "wetter", + "Finanzen": "finanzen", + "Aktuelles": "", + }; + const pathOnly = url.split("?")[0].split("#")[0]; + if (/^\/aktuelles\/?$/.test(pathOnly)) { + res.redirect(301, `${NEWS_HOST}/`); + return; + } + const catRedirect = pathOnly.match(/^\/category\/([^/]+)\/?$/); + if (catRedirect) { + const catName = decodeURIComponent(catRedirect[1]); + const key = Array.from(ONE_RUBRIKEN).find((r) => r.toLowerCase() === catName.toLowerCase()); + if (key) { + const rs = NEWS_RUBRIK_SLUG[key]; + res.redirect(301, rs ? `${NEWS_HOST}/rubrik/${rs}` : `${NEWS_HOST}/`); + return; + } + } + // ---- /category/: prej je vrnil HTML naslovnice s canonical "/" in // brez vsebine, kar je Google bral kot soft 404 / podvojeno naslovnico ---- const catMatch = url.match(/^\/category\/([^?#\/]+)/); @@ -382,35 +411,6 @@ export function serveStatic(app: Express) { } } - // 29. 8. 2026: rubrike Aktuelles so preseljene na loceno stran news.folx.tv. - // Clanki ostanejo v bazi in v /api/articles (bere jih news.folx.tv in TV sidebar), - // na folx.tv pa se naslovi trajno preusmerijo. - const NEWS_HOST = "https://news.folx.tv"; - const NEWS_RUBRIK_SLUG: Record = { - "Politik": "politik", - "Promis": "promis", - "Sport": "sport", - "Musik & Film": "musik-film", - "Wetter": "wetter", - "Finanzen": "finanzen", - "Aktuelles": "", - }; - const pathOnly = url.split("?")[0].split("#")[0]; - if (/^\/aktuelles\/?$/.test(pathOnly)) { - res.redirect(301, `${NEWS_HOST}/`); - return; - } - const catRedirect = pathOnly.match(/^\/category\/([^/]+)\/?$/); - if (catRedirect) { - const catName = decodeURIComponent(catRedirect[1]); - const key = Array.from(ONE_RUBRIKEN).find((r) => r.toLowerCase() === catName.toLowerCase()); - if (key) { - const rs = NEWS_RUBRIK_SLUG[key]; - res.redirect(301, rs ? `${NEWS_HOST}/rubrik/${rs}` : `${NEWS_HOST}/`); - return; - } - } - const articleMatch = url.match(/^\/article\/([^?#]+)/); if (articleMatch) { try {