Skip to content

redirect_from creates duplicate locale prefixes (e.g., /de/de/...) for secondary languages #313

Description

@GruberMarkus

Hi @untra,

I think I found a bug regarding redirect_from page generation in secondary languages. It feels closely related to issue #284 and PR #293.

The problem is that redirect_from links are created perfectly for the main language, but they get broken, duplicated locale paths for secondary languages.

Reproduction Steps

File: 2026-07-03-some-title.en.md (Main Language)

---
layout: "post"
lang: "en"
locale: "en"
title: "Some English title"
description: "Some English description"
slug: "some-title"
permalink: "/blog/:year/:month/:day/:slug"
redirect_from:
  - "/blog/2025/08/11/some-title"
  - "/blog/2025/08/11/some-title/"
---

File: 2026-07-03-some-title.de.md (Secondary Language)

---
layout: "post"
lang: "de"
locale: "de"
title: "Some German title"
description: "Some German description"
slug: "some-title"
permalink: "/blog/:year/:month/:day/:slug"
redirect_from:
  - "/blog/2025/08/11/some-title"
  - "/blog/2025/08/11/some-title/"
---

Observed Behavior

  • Main Language (en): Redirects are generated correctly.
    /blog/2025/08/11/some-title correctly points to /blog/2026/07/03/some-title.

  • Secondary Language (de): The redirect pages are generated at the wrong file paths, duplicating the locale prefix:

    /de/de/blog/2025/08/11/some-title.html
    /de/de/blog/2025/08/11/some-title/index.html
    

    (Note: Inside these wrongly generated files, the target URL metadata actually points to the correct location: /de/blog/2026/07/03/some-title)

Scope

I am observing this faulty path generation for both posts and pages using redirect_from.

Please let me know if you need any further logs or configuration details to help track this down!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions