-
I initially tried to do this in Netlify with a _redirects file to point to my 404.html for any URLs not found. With that method, you see the custom 404 page flash up for a split second before the standard Docusaurus page is shown instead with this text. Page Not Found Is there a proper Docusaurus way to have custom 404 pages? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 21 replies
-
Hi, you can swizzle the And ignore any warnings / cautions that might come up. This is a very safe component. |
Beta Was this translation helpful? Give feedback.
-
Hi Josh, thanks for the fast response. I can confirm this method works. 👍
Then edit |
Beta Was this translation helpful? Give feedback.
-
Is it possible to provide a JSON return conditionally instead of always a page? |
Beta Was this translation helpful? Give feedback.
-
I just realized we had lost our custom 404 page, possibly since upgrading to Docuraurus 3.x I tried the same steps as previously |
Beta Was this translation helpful? Give feedback.
Hi, you can swizzle the
NotFound
component. https://docusaurus.io/docs/using-themes#swizzling-theme-componentsAnd ignore any warnings / cautions that might come up. This is a very safe component.