Custom 404 error page

Hi, I’d like to have a custom 404 page instead of the plain “not found”. Surprisingly enough it is not in the docs and it seems, no one has ever asked it here. My first solution was a rewrite of * to 404.html but then I realized that that would result in a 200 on all routes which is not good.

So can this be done? If so, how?

Thanks

For static sites, Render will look for a custom 404 page at /404.html. This logic kicks in for paths that don’t exist and don’t match any redirect/rewrite rules. We will update our docs to reflect this.

1 Like

I m getting error 404 from search console but it is not redict to 404 or home page gulet.world

Hi @things_to_do_marmari , can you give me a little more information? What is the Render service that you are using that is experiencing this problem? gulet.world appears to be hosted on Namecheap, and not Render.

Hi there! Same here https://moroccosaharatourism.com/
if you found any other solution… :sweat_smile:

What’s wrong with your page? Everything looks fine, I get the custom page and it sends 404

Hi @agrodi ,

Your site is hosted at one‏‏‎.com, so we are unable to help with hosting problems.

I have similar problem. My page is simply not deploying. Here is how terminal looks:
Successfully rebased and updated refs/heads/main.
hello-world main % rackup
Puma starting in single mode…

  • Puma version: 5.6.5 (ruby 3.2.1-p31) (“Birdie’s Version”)
  • Min threads: 0
  • Max threads: 5
  • Environment: development
  •      PID: 20991
    
  • Listening on http://127.0.0.1:9292
  • Listening on http://[::1]:9292
    Use Ctrl-C to stop
    10.240.1.190 - - [09/Nov/2023:21:57:36 +0000] “GET / HTTP/1.1” 200 23 0.0454
    10.240.1.190 - - [09/Nov/2023:21:57:36 +0000] “GET /favicon.ico HTTP/1.1” 404 159 0.0016
    10.240.1.190 - - [09/Nov/2023:21:58:38 +0000] “GET / HTTP/1.1” 304 - 0.0018
    git status
    10.240.4.209 - - [09/Nov/2023:22:31:05 +0000] “GET / HTTP/1.1” 200 23 0.0013
    10.240.1.190 - - [09/Nov/2023:22:40:10 +0000] “GET / HTTP/1.1” 200 23 0.0012
    10.240.1.190 - - [09/Nov/2023:22:41:17 +0000] “GET / HTTP/1.1” 200 23 0.0015
    rackup
    10.240.3.217 - - [09/Nov/2023:23:20:20 +0000] “GET / HTTP/1.1” 200 23 0.0015

https://hello-world-zbo8.onrender.com/ when clicked gives 404 error, thx

How do I change listening to 0.0.0.0? It seems like looking at the local.

Hi,

I’m not seeing a 404 on the URL you shared, have resolved your issue?

Kind regards

Alan

Hi,
Similar :
I do not understand, if I key in :
https://site-productivix.onrender.com/fr/ghjk (which does not exists)
I get the “Not Found” page
I have 404.html page since https://site-productivix.onrender.com/404.html gives me a custom page
The site is in Hugo.
normally the server gives back the 404.html so Render
It does Not

In Hugo, I found the solution:
my site is of a type multilingue translations by Filename
and when I had no 404 custom page, I had in hugo.toml the option :
defaultContentLanguageInSubdir = true
just comment that and the custom 404 page comes back.
#defaultContentLanguageInSubdir = true