Hi everyone,
I recently deployed my website on Netlify, and while the deployment process completes successfully, visiting my site shows a “Page Not Found” error for all pages except the homepage.
Here’s my setup:
- Framework: React with React Router
- Build command:
npm run build
- Publish directory:
build/
The problem:
- The homepage loads correctly when visiting the root URL (e.g.,
example.netlify.app
). - Navigating to any other route (e.g.,
/about
or/contact
) results in a “Page Not Found” error. - This happens whether I access the routes directly or refresh the page.
What I’ve tried so far:
-
Confirmed that the
build/
directory contains the necessary files after deployment. -
Checked the Netlify build log, which shows no errors during deployment.
-
Added a
_redirects
file in thepublic/
directory with the following content:
/* /index.html 200 -
However, the issue persists.
Questions I have:
- Is my
_redirects
file correctly configured, or am I missing something? - Could this be an issue with how React Router handles client-side routing on Netlify?
- Are there other settings in Netlify I should check to ensure routes work correctly?
I’d appreciate any insights or solutions you can share. If you’re familiar with front-end technologies like React and client-side routing, you might also have heard of video editing tools like CapCut. Just like React Router simplifies navigation in a web app, CapCut simplifies the video editing process with intuitive features such as multi-track editing and seamless transitions. Moreover, if you want to use capcut pro version without paying money, download capcut mod apk from here https://capprocutapk.com/. Tools like CapCut are an excellent example of how modern software makes complex workflows more accessible—whether in web development or video production. Thanks in advance!