From the course: The Freelance Stack: Real Project with Next.js and Strapi
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Not found pages - Next.js Tutorial
From the course: The Freelance Stack: Real Project with Next.js and Strapi
Not found pages
Cool, so now we have it set up that if we put in an ID here that doesn't exist, we see this 404 page here, right? Because we said we only want to display anything for the kind of parameters that are coming in here. Now the thing is, we can also create our own 404 page. So if I go into my app directory here and I just add a not found JSX right here and I say this is a new page and I'm just saying sorry in an h3. Sorry we couldn't find what you're looking for Like this now if I go back There we go. Sorry, we couldn't find what you're looking for now That would be happening on every route that is just wrong right like here. We see it if we go to home page Uh, it wouldn't appear but then on any route that we haven't actually defined we will show this page It could be though that you actually want to have a situation in which you want to have for specific route segments different not found pages. So if we go back into Excalidraw, this here for example would be a route segment, right? So…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Why are we using Next.js?6m 11s
-
Setting up a Next.js project3m 52s
-
(Locked)
Simple routing in Next.js4m 11s
-
(Locked)
Layouting in Next.js5m 25s
-
(Locked)
Linking from page to page2m 56s
-
(Locked)
Server and client components overview7m 56s
-
(Locked)
Data fetching6m 7s
-
(Locked)
Dynamic routing12m 59s
-
(Locked)
Not found pages4m 55s
-
-
-
-
-
-
-
-
-
-