# DefaultContentLanguageInSubdir

**URL:** <https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658>\
**Category:** support\
**Created:** [November 24, 2016, 11:18pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658 "2016-11-24T23:18:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreaspada](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/andreaspada/32/696_2.png) [@andreaspada](https://discourse.gohugo.io/u/andreaspada)\
**Post date:** [November 24, 2016, 11:18pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/1 "2016-11-24T23:18:56Z")

</div>

Well, I’m back to Hugo after some months of deliberate absence.

I’m trying to mock-up a skeleton for my next website - which of course has multilingual content - and, after lot of searches, I found the very interesting “[https://github.com/aubort/hugo/blob/multilingual-example/docs/content/content/multilingual.md](https://github.com/aubort/hugo/blob/multilingual-example/docs/content/content/multilingual.md)” tutorial.

I correctly defined some basic translations and multi language content for my languages (English, Italian and Portuguese) and I can display them as expected: mydomain/about, mydomain/it.about, mydomain/br/about… and so on.  
However, I would like to display the url of the english pages also with the ‘en’ slug, for sake of consistency. As far as I understand, if I define DefaultContentLanguageInSubdir as true in my config.toml, that would be achieved, but this is not the case. I experimented with the true and false, publishing and comparing the published folder: they are absolutely identical.

Of course, there’s something I misunderstood. Could someone kindly point me to the right direction?

Many thanks,  
Andrea

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 25, 2016, 1:22am UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/2 "2016-11-25T01:22:08Z")

</div>

Have you defined en as defaultContentLanguage? It is hard to guess without seeing the source.

---

<div class="post-metadata">

**Author:** ![andreaspada](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/andreaspada/32/696_2.png) [@andreaspada](https://discourse.gohugo.io/u/andreaspada)\
**Post date:** [November 25, 2016, 8:53pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/3 "2016-11-25T20:53:46Z")

</div>

Yes, defaultContentLanguage is enabled. I try both with it enabled and disabled, nothing changes…

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 25, 2016, 9:16pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/4 "2016-11-25T21:16:18Z")

</div>

> [@andreaspada](#):
>
> Yes, defaultContentLanguage is enabled. I try both with it enabled and disabled, nothing changes…

OK, so then there is something here we don’t see, which means you will have to post a link to your Hugo source for us to be able to help you further.

---

<div class="post-metadata">

**Author:** ![andreaspada](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/andreaspada/32/696_2.png) [@andreaspada](https://discourse.gohugo.io/u/andreaspada)\
**Post date:** [November 25, 2016, 9:26pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/5 "2016-11-25T21:26:58Z")

</div>

Here it is my bare config. I started from scratch, just to check everything. Same behaviour…

```
# general setup
baseurl = "http://replace-this-with-your-hugo-site.com/"
title = "My New Hugo Site"
theme = "hugo4"

# languages 
languageCode = "en-us"
defaultContentLanguage = "en"
defaultContenLanguageInSubdir = "true"

[languages.en]
[languages.it]
[languages.br]

```

When I browse, I still have the english ‘about’ page under mydomain/about and the italian and portugues version respectively under mydomain/it/about and mydomain/br/about.  
Any clue?

---

<div class="post-metadata">

**Author:** ![andreaspada](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/andreaspada/32/696_2.png) [@andreaspada](https://discourse.gohugo.io/u/andreaspada)\
**Post date:** [November 26, 2016, 12:46pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/6 "2016-11-26T12:46:26Z")

</div>

Well, I do not have how to provide a link, as I’m working on a local machine. Have you some ready multi language skeleton which work as intended, to use as a reference and to learn from?

---

<div class="post-metadata">

**Author:** ![deathbaba](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@deathbaba](https://discourse.gohugo.io/u/deathbaba)\
**Post date:** [December 15, 2016, 7:42pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/7 "2016-12-15T19:42:00Z")

</div>

I’m also interested in any good multi-language template/skeleton with best practices included (menus, localizations for typical content like posts and unique custom pages).

---

<div class="post-metadata">

**Author:** ![GegznaV](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gegznav/32/8965_2.png) [@GegznaV](https://discourse.gohugo.io/u/GegznaV)\
**Post date:** [August 11, 2018, 2:09pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/8 "2018-08-11T14:09:10Z")

</div>

Any news on this issue?

---

<div class="post-metadata">

**Author:** ![martignoni](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/martignoni/32/5756_2.png) [@martignoni](https://discourse.gohugo.io/u/martignoni)\
**Post date:** [August 12, 2018, 9:44am UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/9 "2018-08-12T09:44:40Z")

</div>

I’ve began to create such an example in my theme “MoodleBox”: It’s not finished, but you may find something useful. See it in action here: [moodlebox.net](http://moodlebox.net)

> **[moodlebox/hugo-moodlebox-theme](https://github.com/moodlebox/hugo-moodlebox-theme)**
>
> A Hugo theme for MoodleBox website. Contribute to moodlebox/hugo-moodlebox-theme development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![GegznaV](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gegznav/32/8965_2.png) [@GegznaV](https://discourse.gohugo.io/u/GegznaV)\
**Post date:** [August 12, 2018, 7:58pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/10 "2018-08-12T19:58:14Z")

</div>

I moved the lines

```auto
defaultContentLanguage = "en"
defaultContenLanguageInSubdir = "true"

```

from the end to almost the beginning of the `toml` file and they began working as expected. Of course, it is strange to me that the place in the `toml` file had such an impact (i.e., that when the commands were at the end of the file, they were ignored).

---

<div class="post-metadata">

**Author:** ![Deimos-94](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/deimos-94/32/21193_2.png) [@Deimos-94](https://discourse.gohugo.io/u/Deimos-94)\
**Post date:** [February 5, 2024, 6:25am UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/11 "2024-02-05T06:25:48Z")

</div>

This fixed it for me!

moving:

```auto
defaultContentLanguage = 'en'
defaultContentLanguageInSubdir = false

```

higher in the config file made it apply!

---

<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:** [February 5, 2024, 1:55pm UTC](https://discourse.gohugo.io/t/defaultcontentlanguageinsubdir/4658/12 "2024-02-05T13:55:23Z")

</div>

Archived on February 5, 2024, 1:55pm UTC


