# How to set 404 Page's Params

**URL:** <https://discourse.gohugo.io/t/how-to-set-404-pages-params/34489>\
**Category:** support\
**Created:** [August 29, 2021, 6:07am UTC](https://discourse.gohugo.io/t/how-to-set-404-pages-params/34489 "2021-08-29T06:07:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cryptic-code](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@cryptic-code](https://discourse.gohugo.io/u/cryptic-code)\
**Post date:** [August 29, 2021, 6:07am UTC](https://discourse.gohugo.io/t/how-to-set-404-pages-params/34489/1 "2021-08-29T06:07:07Z")

</div>

Hugo Docs’ [page](https://gohugo.io/templates/404/) for 404 template states that:

> 404 pages will have all the regular [page variables](https://gohugo.io/variables/page/) available to use in the templates.

However, I was unable to set `.Params` through front-matter with `content/404.md` as usual.

I see there was a similar [post](https://discourse.gohugo.io/t/define-404-page-content-in-an-md-file-under-the-content-directory/13943) in 2018 and a [GitHub issue](https://github.com/gohugoio/hugoDocs/issues/585) created by @alexandros for this. But it was closed due to inactivity.

Replies to the mentioned post include some workarounds. But has the issue been resolved in the past 3 years? And if not, what is the “right way” to do this?

PS: Passing params include changing `.Title` of the 404 page and such. By default, `404 Page not found` is passed by Hugo.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![cryptic-code](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@cryptic-code](https://discourse.gohugo.io/u/cryptic-code)\
**Post date:** [August 29, 2021, 6:25am UTC](https://discourse.gohugo.io/t/how-to-set-404-pages-params/34489/2 "2021-08-29T06:25:49Z")

</div>

Was just playing around…and found that `.Kind` for the 404 page is literally `404`. Is it the correct way to detect a 404 page? And should it be used to write the template logic if setting `.Params` is not possible?

---

<div class="post-metadata">

**Author:** ![divinerites](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/divinerites/32/12625_2.png) [@divinerites](https://discourse.gohugo.io/u/divinerites)\
**Post date:** [August 29, 2021, 6:44am UTC](https://discourse.gohugo.io/t/how-to-set-404-pages-params/34489/3 "2021-08-29T06:44:15Z")

</div>

I use this, for example : ` {{ if eq .Page.Kind "404" }}`

---

<div class="post-metadata">

**Author:** ![cryptic-code](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@cryptic-code](https://discourse.gohugo.io/u/cryptic-code)\
**Post date:** [August 29, 2021, 8:38am UTC](https://discourse.gohugo.io/t/how-to-set-404-pages-params/34489/4 "2021-08-29T08:38:32Z")

</div>

@divinerites Yeah. But I was wondering if that is actually the “hugo way” of doing it. Since docs say otherwise.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [August 29, 2021, 3:14pm UTC](https://discourse.gohugo.io/t/how-to-set-404-pages-params/34489/5 "2021-08-29T15:14:10Z")

</div>

The built-in 404 functionality is limited and specific to a single error page (404). In my view this is a better approach:

```auto
content
└── errors/
    ├── 400.md
    ├── 401.md
    ├── 403.md
    ├── 404.md
    └── _index.md
layouts
└── errors/
    └── single.html

```

content/errors/\_index.md

```auto
[_build]
  list = 'never'
  render = 'never'
[cascade._build]
  list = 'never'

```

Just make sure to reconfigure the error page paths on your production server.

```nohighlight
errors/400/index.html
errors/401/index.html
errors/403/index.html
errors/404/index.html

```

See related discussion:  
[https://github.com/gohugoio/hugo/issues/8924](https://github.com/gohugoio/hugo/issues/8924)

---

<div class="post-metadata">

**Author:** ![cshoredaniel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cshoredaniel/32/19684_2.png) [@cshoredaniel](https://discourse.gohugo.io/u/cshoredaniel)\
**Post date:** [August 30, 2021, 9:02am UTC](https://discourse.gohugo.io/t/how-to-set-404-pages-params/34489/6 "2021-08-30T09:02:34Z")

</div>

@jmooring Thanks for this. I think this tidbit along with adding some examples (or at least links to) server configs (and services like Netlify; I know you can do this on Netlify, but it’s not immediately obvious for new users, and I forget the steps involved although I can figure them out) in the docs would probably be helpful as well. I’ll add that my to do list, but it’s not a high priority item for me, so hopefully someone beats me to it.
