Aliases for tag names

I have tag name with url e.g. https://***/subject/tagnameabcnew.

/subject/ is used instead /tags/.

this tag has its own page in /content/tags/tagnameabcnew/

I set “Aliases” with old tag name urls like:

  • /subject/tagnameabc/
  • /subject/anothersimilartagname/

When I open older url there should be redirection to the current “tagnameabcnew”, but instead the empty taxonomy page with old tag name is displayed.

    changefreq: weekly
    priority: 0.9
title: Some Title
date: a date
draft: false
slug: tagnameabcnew
- /subject/tagnameabc/
- /subject/anothertagname/

That should be (with an underscore). Taxonomy and term pages are lists.

yes there is underscore

How are you changing the permalink? In site config or in front matter. Either way, please provide example.

This setup works as expected (requires v0.115.0 or later):

git clone --single-branch -b hugo-forum-topic-47779 hugo-forum-topic-47779
cd hugo-forum-topic-47779
hugo server

I change the permalink in site config:

  tags: /subject/:slug

Test the example above using v0.115.0.

I use Hugo 0.117.0

It seems only 1st alias work, 2nd and 3rd doesn’t.

I am unable to reproduce the problem. Please pull changes from my previous example… works as expected.

Tested with v0.117.0 and v0.121.2.

Problem solved. It was my mistake.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.