Custom 404 Page
November 26, 2018 at 1:14pmThe 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:14pmAm 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
We don't support it at the moment. (https://spectrum.chat/thread/2ea83669-e526-4f63-8397-c7a0e801a49b)
An alternative would be to have your application deal with all the routing, therefore serving 404 custom pages when needed.
December 5, 2018 at 5:21pm
We do support status
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' }`
February 19, 2019 at 7:54pm
February 25, 2019 at 8:04am
March 11, 2019 at 2:51am
Is 404 route customisation on the roadmap?
March 11, 2019 at 11:18am
March 28, 2019 at 2:54pm
Not yet .
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
Built the Next application with a static target in mind. Its kind of strange to not be able to declare a catch all 404.
Cron jobs are cool and all but ive got clients breathing down my neck on this one.
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 ?
April 20, 2019 at 8:49pm
April 22, 2019 at 3:11pm
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" }]
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. 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 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!April 30, 2019 at 1:54pm
any updates?
any updates?
Not yet. We are working on a few blockers first.
May 3, 2019 at 6:33am
Thanks! Let me know if I can help out in any way. :)
This channel has been archived