# 404 error on content folder when deployed to netlify

**URL:** <https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946>\
**Category:** Uncategorized\
**Created:** [March 8, 2018, 4:11pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946 "2018-03-08T16:11:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![sh1tr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sh1tr](https://discourse.gohugo.io/u/sh1tr)\
**Post date:** [March 8, 2018, 4:11pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/1 "2018-03-08T16:11:12Z")

</div>

I am getting 404 error on my content folder when deployed to netlify, but not when run locally.

Here is my repo:

> **[sh1tr/medicalrecordsrx](https://github.com/sh1tr/medicalrecordsrx)**
>
> Site for Medical Records Rx. Contribute to sh1tr/medicalrecordsrx development by creating an account on GitHub.

Here is my site deployed to netlify:  
[http://www.medicalrecordsrx.com/](http://www.medicalrecordsrx.com/)

The “nights” menu item goes to nights content when running locally, but I get a 404 error when using the menu when deployed on netlify.

I have tried modifying my baseURL, adding and subtracting content from my netlify.toml file, renaming the content and the content folders, and I slept on it. I have no idea at this time why it works locally and not on netlify. Another other guess is that my pluralized list titles might be causing a problem, but I would think that unlikely, or that there is a setting in netlify that needs to be set for my content.

Any insight or help is appreciated.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [March 8, 2018, 4:13pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/2 "2018-03-08T16:13:59Z")

</div>

What is the purpose of these wildcards in your .gitignore file?

> ```
> *~
> #*
> 
> ```

---

<div class="post-metadata">

**Author:** ![sh1tr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sh1tr](https://discourse.gohugo.io/u/sh1tr)\
**Post date:** [March 8, 2018, 4:15pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/3 "2018-03-08T16:15:00Z")

</div>

Emacs backup files. I could have Emacs store them all in one place, but I kind of like them littered about.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [March 8, 2018, 4:16pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/4 "2018-03-08T16:16:55Z")

</div>

How about trying to remove them? And then see if your issue is resolved.

Also it’s good practice to include the public folder in your .gitignore

---

<div class="post-metadata">

**Author:** ![sh1tr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sh1tr](https://discourse.gohugo.io/u/sh1tr)\
**Post date:** [March 8, 2018, 4:19pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/5 "2018-03-08T16:19:16Z")

</div>

I’ll try that, but I would hope the netlify isn’t reading my .gitignore file to deploy my site. That would be weird, don’t you think?

My site doesn’t have a public folder. Is that normal?

---

<div class="post-metadata">

**Author:** ![sh1tr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sh1tr](https://discourse.gohugo.io/u/sh1tr)\
**Post date:** [March 8, 2018, 4:22pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/6 "2018-03-08T16:22:03Z")

</div>

OK, that has been done, still 404.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [March 8, 2018, 4:27pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/7 "2018-03-08T16:27:40Z")

</div>

It’s very weird for Hugo not being able to find the /content/ folder. Your config seems ok.

The only weird thing I noticed was the content of your .gitignore file. Beyond that maybe someone else can take a look.

Also regarding the /public/ folder if you type hugo the public folder will be generated in your repo along with the html of your site. It’s just an option so that your repo doesn’t get bloated.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [March 8, 2018, 4:33pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/8 "2018-03-08T16:33:40Z")

</div>

I downloaded and tested your site locally.

When I run hugo server I was greeted with an empty page.

I took a better look at your config.

Remove the following line from your main menu configuration

> ` url = "/nights"`

And the site will be generated.

**EDIT**  
If you want the “nights menu” to appear only under your `/nights/` section you do this in the template not in your config.

Cool music BTW.

---

<div class="post-metadata">

**Author:** ![sh1tr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sh1tr](https://discourse.gohugo.io/u/sh1tr)\
**Post date:** [March 8, 2018, 5:12pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/9 "2018-03-08T17:12:01Z")

</div>

Cloning my own repo into a new directory and running the site was something i didn’t try. That is a good test. When I do that it runs fine. Everything works as expected despite there being a bunch of missing folders. What version of hugo are you using? It might be a version issue which is why we are getting different results. I am running v0.37.1 linux/amd64 .

As for removing the “/nights” from my config, this breaks my menu. It seems like I used these correctly based on this documentation -\> [https://gohugo.io/content-management/menus/#add-non-content-entries-to-a-menu](https://gohugo.io/content-management/menus/#add-non-content-entries-to-a-menu) \<- I do notice that they have a trailing “/”, I can try that next.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [March 8, 2018, 5:14pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/10 "2018-03-08T17:14:48Z")

</div>

I tested on a Mac with Hugo 0.37

---

<div class="post-metadata">

**Author:** ![sh1tr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sh1tr](https://discourse.gohugo.io/u/sh1tr)\
**Post date:** [March 8, 2018, 5:26pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/11 "2018-03-08T17:26:30Z")

</div>

OK, I’ll find someone with a mac and see if I can get the same results. Might not be for a bit. Thank you for your help and the kind words on the tunes!

---

<div class="post-metadata">

**Author:** ![sh1tr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sh1tr](https://discourse.gohugo.io/u/sh1tr)\
**Post date:** [March 10, 2018, 10:54pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/12 "2018-03-10T22:54:25Z")

</div>

My friend has a Mac. He cloned the repo and ran the site no problem without editing the config. The problem is the the deploy for sure.

My next guess is that there is a problem with netlify.toml file.

---

<div class="post-metadata">

**Author:** ![sh1tr](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sh1tr](https://discourse.gohugo.io/u/sh1tr)\
**Post date:** [March 10, 2018, 11:15pm UTC](https://discourse.gohugo.io/t/404-error-on-content-folder-when-deployed-to-netlify/10946/13 "2018-03-10T23:15:03Z")

</div>

Ha! I got it. I had been running `server` as `server -D` this whole time, where netlify was not. I removed the draft variable from my header in nights and it fixed the problem.
