Next 13 (app router) redirect to not-found page with proper (404) status
Hello guys! good evening to everyone! I faced with a problem, i have an app, with dynamic routes on next 13, in one of that routes i want to redirect to not-found page, if slug, provided from url is wrong or not exist. For this purpose i use notFound() function from next/navigation.
It's redirect user to proper page, everything fine, but the status of requested page is 200, which is a problem, because of SEO. All these components are server components. How to fix it? If i use static routes and pass not exist url, it works like charm. Thanks in advance!
It's redirect user to proper page, everything fine, but the status of requested page is 200, which is a problem, because of SEO. All these components are server components. How to fix it? If i use static routes and pass not exist url, it works like charm. Thanks in advance!


