# \[SOLVED\] Can't display my content and always 404

**URL:** <https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469>\
**Category:** Uncategorized\
**Created:** [September 28, 2018, 9:25am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469 "2018-09-28T09:25:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZeYu\_Hou](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@ZeYu\_Hou](https://discourse.gohugo.io/u/ZeYu_Hou)\
**Post date:** [September 28, 2018, 9:25am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/1 "2018-09-28T09:25:10Z")

</div>

Hi, I am a beginner for Hugo. I already finish my list.html in layouts folder.  
And then I create a single.html for my content.  
But when I run “hugo server” and link to my content, it always display 404.  
There is my [code](https://github.com/Hzyu810225/LearnHugo)  
What point I lose?  
How do I solve it?  
Thank you.

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [September 28, 2018, 9:38am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/2 "2018-09-28T09:38:44Z")

</div>

Is your `<a>` tag well formed?

> <https://github.com/Hzyu810225/LearnHugo/blob/master/layouts/list.html#L10>

Maybe you need `<a href="{{.URL}}"> {{.Title}} </a>`.

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [September 28, 2018, 9:58am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/3 "2018-09-28T09:58:03Z")

</div>

By the way @ZeYu_Hou, it’s better to use `.Permalink` or `.RelPermalink`, because `.Page.URL` is marked for [deprecation](https://github.com/gohugoio/hugo/issues/4117) at some point.

---

<div class="post-metadata">

**Author:** ![ZeYu\_Hou](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@ZeYu\_Hou](https://discourse.gohugo.io/u/ZeYu_Hou)\
**Post date:** [September 29, 2018, 3:54am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/4 "2018-09-29T03:54:13Z")

</div>

Not solve…still print 404…

---

<div class="post-metadata">

**Author:** ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)\
**Post date:** [September 29, 2018, 4:28am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/5 "2018-09-29T04:28:26Z")

</div>

Ok, I had a few minutes to download your site and try it.

Just move your `list.html` and `single.html` into `/layouts/_default` and it should work (this is what fixed the 404 for me).

---

<div class="post-metadata">

**Author:** ![ZeYu\_Hou](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@ZeYu\_Hou](https://discourse.gohugo.io/u/ZeYu_Hou)\
**Post date:** [September 29, 2018, 6:27am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/6 "2018-09-29T06:27:48Z")

</div>

Yeap, it fixed 404, but the {{.Content}} is empty now. I can’t show my content when I visit  
“[http://localhost:1313/daily02/](http://localhost:1313/daily02/)”

---

<div class="post-metadata">

**Author:** ![funkydan2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/funkydan2/32/5636_2.png) [@funkydan2](https://discourse.gohugo.io/u/funkydan2)\
**Post date:** [September 29, 2018, 7:11am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/7 "2018-09-29T07:11:47Z")

</div>

Can you push your changes to github so we can see where things are up to? It’s hard to help when github still has your `single.html` and `list.html` not in the `_default` folder.

---

<div class="post-metadata">

**Author:** ![ZeYu\_Hou](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@ZeYu\_Hou](https://discourse.gohugo.io/u/ZeYu_Hou)\
**Post date:** [September 29, 2018, 7:22am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/8 "2018-09-29T07:22:27Z")

</div>

Thank you. I push my [folder](https://github.com/Hzyu810225/LearnHugo.git) again

---

<div class="post-metadata">

**Author:** ![funkydan2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/funkydan2/32/5636_2.png) [@funkydan2](https://discourse.gohugo.io/u/funkydan2)\
**Post date:** [September 29, 2018, 7:38am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/9 "2018-09-29T07:38:45Z")

</div>

You need to rename `layouts/default` to `layouts/_default` - the \_ is important.

And now, when you run `hugo server -D` you should see content at [http://localhost:1313/daily01](http://localhost:1313/daily01) etc. (You need the `-D` flag to build draft and non-draft pages.)

---

<div class="post-metadata">

**Author:** ![ZeYu\_Hou](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@ZeYu\_Hou](https://discourse.gohugo.io/u/ZeYu_Hou)\
**Post date:** [September 29, 2018, 7:56am UTC](https://discourse.gohugo.io/t/solved-cant-display-my-content-and-always-404/14469/10 "2018-09-29T07:56:43Z")

</div>

Thank you, let me try again.
