Redirect from _index.md

Hi all!
I’m trying to create an aliases. Here is my content structure:

content
    |_about
        |_index.md
        |_test1.md
        |_test2.md

I can open such urls as

localhost:1313/about, localhost:1313/about/test1, localhost:1313/about/test2.

I’m trying to use aliases to make localhost:1313/about to redicrect to localhost:1313/about/test1. I made such a change in fronmatter of localhost:1313/about/test1, but it didn’t help

---
title: About page
aliases:
  - /about/
  - /test/
---

localhost:1313/test redicrects correctly to localhost:1313/about/test1, but localhost:1313/about still shows it’s inital page, but not localhost:1313/about/test1. Can somebody, please help me with the issue?

What you are trying to achieve is not possible.
https://gohugo.io/content-management/urls/#important-behaviors-of-aliases

Aliases are rendered before any content are rendered and therefore will be overwritten by any content with the same location.

1 Like

Just use server redirects or the _redirects file if you use Netlify or Cloudflare Pages.

3 Likes