# Custom 404 does not work for /netlify.toml

**URL:** <https://answers.netlify.com/t/custom-404-does-not-work-for-netlify-toml/21581>\
**Category:** Support\
**Tags:** redirects\
**Created:** [August 29, 2020, 11:12am UTC](https://answers.netlify.com/t/custom-404-does-not-work-for-netlify-toml/21581 "2020-08-29T11:12:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvhellemond](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/jvhellemond/32/5492_2.png) [@jvhellemond](https://answers.netlify.com/u/jvhellemond)\
**Post date:** [August 29, 2020, 11:12am UTC](https://answers.netlify.com/t/custom-404-does-not-work-for-netlify-toml/21581/1 "2020-08-29T11:12:51Z")

</div>

Hi,

I have a redirect for custom 404 error pages, like this:

```
[[redirects]]
from = "/*"
to = "/error"
status = 404

```

Works like a charm, great. All non-existing paths that I try in a browser end up on that page. Except one: `/netlify.toml`

I do get a 404 (as expected), but not my custom 404 error page. Instead I get the generic Netlify 404 error page. This is not really a problem, but it does, I think, betray the presence of a `netlify.toml` on the server. This might be the tiniest of insignificantest security concerns.

I tried `/_redirects` and `/_headers`, but I get the expected custom 404 page for those.

Is there a way to redirect all non-existing (and presumedly globally excluded paths) to my custom 404 error page?

Kind regards,

Jan

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [August 31, 2020, 5:41pm UTC](https://answers.netlify.com/t/custom-404-does-not-work-for-netlify-toml/21581/2 "2020-08-31T17:41:12Z")

</div>

hey Jan! thanks for pointing that out. I’m gonna get some 👀 on this and we’ll see if this is something we want to change. Appreciate the report!
