# How can I forward/ alias to an other page?

**URL:** <https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127>\
**Category:** support\
**Created:** [April 29, 2020, 3:15pm UTC](https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127 "2020-04-29T15:15:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Louis\_Harlinghausen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/louis_harlinghausen/32/10971_2.png) [@Louis\_Harlinghausen](https://discourse.gohugo.io/u/Louis_Harlinghausen)\
**Post date:** [April 29, 2020, 3:15pm UTC](https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127/1 "2020-04-29T15:15:25Z")

</div>

I want to forward from one of my pages to another and I can’t find a solution for that.  
I have these two sites:  
`content/post/oldpost.md` and `content/newpost.md`

The Urls look like these:  
[mysite.com/oldpost](http://mysite.com/oldpost) and [mysite.com/newpost](http://mysite.com/newpost)

I was thinking an alias would be the solution, so I tried this in the frontmatter of my new post:  
—  
aliases:  
- /oldpost/  
—  
but it don’t works, where is the mistake?

---

<div class="post-metadata">

**Author:** ![Hash\_Borgir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hash_borgir/32/6655_2.png) [@Hash\_Borgir](https://discourse.gohugo.io/u/Hash_Borgir)\
**Post date:** [April 29, 2020, 5:20pm UTC](https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127/2 "2020-04-29T17:20:01Z")

</div>

If newpost has alias=/oldpost, then when you go to /oldpost you will end up at /newpost

You can add oldpost alias=/newpost and when you got to /newpost you will end up at old post.

If you want to forward /this to /that you can setup a http meta refresh tag.

`<meta http-equiv="refresh" content="0;URL='http://thetudors.example.com/'" /> `

[https://www.w3.org/TR/WCAG20-TECHS/H76.html](https://www.w3.org/TR/WCAG20-TECHS/H76.html)

You can define page meta tags in front matter and read them using .Params. perhaps

EDIT: Or perhaps if you have access to .htaccess or your nginx site enabled file, you can use redirect there, 301 or 302 depending on what you want.

---

<div class="post-metadata">

**Author:** ![Louis\_Harlinghausen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/louis_harlinghausen/32/10971_2.png) [@Louis\_Harlinghausen](https://discourse.gohugo.io/u/Louis_Harlinghausen)\
**Post date:** [April 30, 2020, 9:17am UTC](https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127/3 "2020-04-30T09:17:55Z")

</div>

Ok thank you for your help, but I’m still not able to do the alias.  
Im using YAML in my Frontmatter and this is the Frontmatter of the newpost:

```
---
title: "Alias problem"
draft: false
url: "/newpost"
aliases:
- /oldpost/
---

```

But nothing happens. Do I miss something very easy?  
Do I need to enable something that this works?

Do you have an example project for the meta refresh tag?

---

<div class="post-metadata">

**Author:** ![Louis\_Harlinghausen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/louis_harlinghausen/32/10971_2.png) [@Louis\_Harlinghausen](https://discourse.gohugo.io/u/Louis_Harlinghausen)\
**Post date:** [April 30, 2020, 1:29pm UTC](https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127/4 "2020-04-30T13:29:36Z")

</div>

Ok. I got the redirect via the http meta refresh tag now.  
But still would like to know, what the issue with the alias is.

---

<div class="post-metadata">

**Author:** ![Hash\_Borgir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hash_borgir/32/6655_2.png) [@Hash\_Borgir](https://discourse.gohugo.io/u/Hash_Borgir)\
**Post date:** [April 30, 2020, 1:38pm UTC](https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127/5 "2020-04-30T13:38:37Z")

</div>

http meta refresh is basically what hugo does as well when you create an alias. When aliases are specified, Hugo creates a directory to match the alias entry. Inside the directory, Hugo creates an .html file specifying the canonical URL for the page and the new redirect target.

In your front matter example, if you go to /oldpost, you should end up at /newpost which seems correct.

Does the alias in yaml need to be quoted as well?

---

<div class="post-metadata">

**Author:** ![Louis\_Harlinghausen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/louis_harlinghausen/32/10971_2.png) [@Louis\_Harlinghausen](https://discourse.gohugo.io/u/Louis_Harlinghausen)\
**Post date:** [May 1, 2020, 7:26am UTC](https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127/6 "2020-05-01T07:26:22Z")

</div>

Ah that makes sense. I tried quotes, but it makes no difference.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [May 3, 2020, 7:26am UTC](https://discourse.gohugo.io/t/how-can-i-forward-alias-to-an-other-page/25127/7 "2020-05-03T07:26:22Z")

</div>

Closed on May 3, 2020, 7:26am UTC

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