menu

ZEIT

Our mission is to make cloud computing as easy and accessible as mobile computing. You can find our Next.js community here.

Channels
Team
The ZEIT community has a new home. This thread is preserved for historical purposes. The content of this conversation may be innaccurrate or out of date. Go to new community home →

Custom 404 Page

November 26, 2018 at 1:14pm
Am using /static-build for a Gatsby site on v2 of Now, as per the official example.
The problem I have is that any missing route is served the internal Now 404 page, instead of my custom one. Is there something I should be doing under the routes key in my config to catch anything unmatched?

November 26, 2018 at 1:44pm
An alternative would be to have your application deal with all the routing, therefore serving 404 custom pages when needed.
Edited
  • reply
  • like

December 5, 2018 at 5:21pm
Would be nice to be able to return the 404 status code as well
like-fill
1
  • reply
  • like

December 12, 2018 at 2:33pm
Sorry meant serve the the custom 404 page with a 404 status code. Currently if you set the status to 404 you will get the 404 status but the zeit 404 page and not your own. For example this does not work `{ src: '/.*', status: 404, dest: '/404.html' }`
like-fill
1
  • reply
  • like
Indeed, good catch!
  • reply
  • like

February 19, 2019 at 7:54pm
any updates on this feature?
like-fill
3
  • reply
  • like

February 25, 2019 at 8:04am
also looking for this feature
like-fill
3
  • reply
  • like

March 11, 2019 at 2:51am
Is 404 route customisation on the roadmap?
  • reply
  • like

March 11, 2019 at 11:18am
Sure it is! However, we are working on a few more critical features at the moment, like now dev and cronjobs.
  • reply
  • like

March 28, 2019 at 2:54pm
Any updates on this? the current 404 includes a link to /status-codes on zeit docs and Im not a fan this
  • reply
  • like
Not yet .
  • reply
  • like

April 10, 2019 at 8:22pm
has there been any progress on these custom 404 pages? We have a very large project that needs this functionality
  • reply
  • like
Built the Next application with a static target in mind. Its kind of strange to not be able to declare a catch all 404.
  • reply
  • like
Cron jobs are cool and all but ive got clients breathing down my neck on this one.
  • reply
  • like
I can't give you an ETA, but we are aware this is critical for some of our customers. Can you DM me telling more about your needs ?
  • reply
  • like

April 20, 2019 at 8:49pm
Hi everybody! For sure we need this feature too. We cannot image to have a page with a different look & feel than the other pages! -> very confusing for the customers...
like-fill
1
  • reply
  • like

April 22, 2019 at 3:11pm
This is the only reason for me to put on-hold a migration to v2. I really need a custom 404/500 etc
like-fill
3
  • reply
  • like

April 25, 2019 at 9:54pm
People, we have support for custom 404 now! Please, test it and let me know. Documentation will be released in a few days:
"routes": [
{ "src": "/", "dest": "/index.html" },
{ "src": "/about", "dest": "/about.html" },
{ "src": "/blog/(.*)", "dest": "/blog/$1" },
{ "handle": "filesystem" },
{ "src": "/.*", "status": 404, "dest": "404.html" }
]
like-fill
6
  • reply
  • like

April 26, 2019 at 12:46pm
Hey ! I tried this with no luck. Is it live yet? Here's my now.json:
{
"version": 2,
"builds": [
{ "src": "index.html", "use": "@now/static" },
{ "src": "py.py", "use": "@now/python" },
{ "src": "js.js", "use": "@now/node" },
{ "src": "php.php", "use": "@now/php" },
{ "src": "go.go", "use": "@now/go" },
{ "src": "404.html", "use": "@now/static" }
],
"routes": [
{ "src": "/(.*)", "dest": "/$1" },
{ "handle": "filesystem" },
{ "src": "/.*", "status": 404, "dest": "404.html" }
]
}
When I go to <my-project>.now.sh/something I still get the same (default) 404 page.
  • reply
  • like
Great! I think I will wait for the docs first, in my case Im using a custom _error.js page and not sure how to route it properly
  • reply
  • like
We have a bug, sorry! It seems when you do "status": 404 our proxy is ignoring some needed logic for the custom 404. We are working on it as we speak!
  • reply
  • like

April 30, 2019 at 1:54pm
any updates?
  • reply
  • like
any updates?
Not yet. We are working on a few blockers first.
  • reply
  • like

May 3, 2019 at 6:33am
Thanks! Let me know if I can help out in any way. :)
  • reply
  • like
Show more messages
private
This channel has been archived