Page not found for some links

Hi, i am having the same issue. i have just uploaded a website and it has ‘/projects’ page, in there, there are links to other websites, but when i come back, it is showing page not found, as long as i go to home page, then it is working.
As you shown, i found the x-nf-request-id:

x-nf-request-id: 8aacaf86-d771-4f44-87af-8bd407981876-5597827

Here is that. Pls Help! Thanks!

hi @AxelReid , please start a new post with all the relevant information, such as a link to your site, what you have already tried, etc. thanks!

hi, thanks for replay. I didn’t know what to do. https://axelreid-webdev.netlify.app. This is the website, i recently uploaded.
i have multiple pages. When i go to projects page and when to click on any of the projects there, it leads to another link outside to that specific project’s link, and when i go back. in that means, when my website’s current link is https://axelreid-webdev.netlify.app/projects, it is saying page not found. And even whichever page i go, in that case ‘/page-name’ after my link and refresh the page, ‘not found’. Only the case it find is when the link is without any page specification (https://axelreid-webdev.netlify.app)… . Pls, go to this link and projects page, click on any project there, and go back. You ll see. Thank you! Hope you understand!

Hi, @AxelReid. There is a solution for this!

You just need a redirect rule for a “single page application” (or SPA):

If you create that redirect all URLs are redirect to index.html. This is what you want with a SPA because the SPA is doing “client side routing”. This SPA redirect rule allows all URLs (meaning all URLs which are not real static assets - so the SPA rule doesn’t impact URLs for images, javascript, and CSS) to be handled by the client side javascript (which is what you want for a SPA).

If that doesn’t solve the issue or if there are questions about how to make the redirects, please let us know.

1 Like

Hi, thanks for reply. I red the doc but didn’t really understand how to set up a redirect rule for my sing page app. I created this site in React with React Router. To deploy, I first npm run build then gave the build folder as a directory path… .Pls, show me how to do it. Thanks!

After reading about _redirects. I created _redirects file in my public folder and inside the file, i wrote ‘/* /index.html 200’. And now it is even saying not found the whole page. pls help!

oo yeah, as my build path is site directory, i placed that _redirects file there and everything is fine. Thanks for help Netlify Team!

2 Likes

Hey there, @AxelReid :wave:

So glad to hear everything is working now :netliconfetti: Thanks for sharing what you did to solve this!