Possile add same 404 error page for every subdomains?

Hi,
Possible add 404.html for every subdomain? Beacause add 404.html file for every “branch” (subdomain) is not effective.

OR

Redirect every 404 error to 404.html :thinking: or something else.

Sorry for my bad English. I am from Slovakia.

hi @Anonymus2020. are you talking about all of the subdomains on one apex domain or all of the subdomains on multiple apex domains?

for example :

html 404 saved at assets.example.com/404.html
add for all subdomains of domain
example
apps.example.com
about.example.com

I believe you could do a redirect:

using something like
*.example.com /404.html

specific 404 doc here:

i try
*.example.com example.com/404 to _redirects in “master” branch
dont work

The rule you’ll want will be:

/* /404.html 404

And you’ll want to make sure that /404.html is changed to the path wherever your 404 is.

Here’s the docs again, just in case :slight_smile:

Does this match on subdomains?
IE: any path .example.com without a route, will now result in example.com/404.html ?
I don’t actually see this in the docs that /
would match on subdomains?

Oh rats, apologies. No, you’re right, you’ll need to explicitly define each subdomain.

If each subdomain is its own site or branch subdomain then yes, my example would work. How are your subdomains configured?

i have web epik.tk
what i there put to _redirects ?

just every subdomain / branch same 404 as epik.tk/404.html

Hey! If you’re looking to use branch subdomains, each branch will typically have its own _redirects.

Are you using Netlify DNS? If so, you will want to check out this article. If not, there’s some additional config required.

Do you have a link to the site(s) and can you elaborate more on your issue too?