# 404 layout in local multilingual environment

**URL:** <https://discourse.gohugo.io/t/404-layout-in-local-multilingual-environment/44212>\
**Category:** support\
**Created:** [May 5, 2023, 6:00am UTC](https://discourse.gohugo.io/t/404-layout-in-local-multilingual-environment/44212 "2023-05-05T06:00:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![idarek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idarek/32/26229_2.png) [@idarek](https://discourse.gohugo.io/u/idarek)\
**Post date:** [May 5, 2023, 6:00am UTC](https://discourse.gohugo.io/t/404-layout-in-local-multilingual-environment/44212/1 "2023-05-05T06:00:25Z")

</div>

I have followed [Custom 404 Page](https://gohugo.io/templates/404/) setup by creating 404.html in my layout. As my website is multilangual I have set 404.en.html as well and in netlify I got rule set to use right 404 page based on site language

```auto
/en/* /en/404.html 404

```

My question is on local environment. Some time ago it was implemented that hugo will resolve 404 errors and serve 404 website. Its working fine for main language, but anything for other language in local environment is returning main language 404 page instead localised.

Is that a bug or limitation.

I always can access it `/en/404.html` to see how it will look in production environment, but still, in local?

---

<div class="post-metadata">

**Author:** ![Arif](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arif/32/20931_2.png) [@Arif](https://discourse.gohugo.io/u/Arif)\
**Post date:** [May 5, 2023, 7:06am UTC](https://discourse.gohugo.io/t/404-layout-in-local-multilingual-environment/44212/2 "2023-05-05T07:06:49Z")

</div>

You need to configure the language inside `config/development/server.toml` (I found this solution somewhere on this forum by @jmooring ).

```auto
[[redirects]]
	from = '/en/**'
	to = '/en/404.html'
	status = 404

[[redirects]] # Default language should be last.
	from = '/**'
	to = '/404.html'
	status = 404

```

But perhaps it should be documented on the 404 page in the docs.

---

<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 7, 2023, 7:07am UTC](https://discourse.gohugo.io/t/404-layout-in-local-multilingual-environment/44212/3 "2023-05-07T07:07:49Z")

</div>

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