DEV Community

Cover image for How to solve Vercel and Netlify "Page Not Found" after page refresh [SOLVED]

How to solve Vercel and Netlify "Page Not Found" after page refresh [SOLVED]

Sakib Ahmed on February 27, 2023

Worst Worst Worst. What? You obviously deployed your React App in vercel or netlify right? If you are using react-router then you must face the sh...
Collapse
 
theksbd profile image
Đỗ Thiện Hoàng

Great job, Sakib! What about Render 🤔? I still can't figure it out how to solve this when deploying to render.com

Collapse
 
devvsakib profile image
Sakib Ahmed

you can try this one, not sure but may help

Image description

Collapse
 
theksbd profile image
Đỗ Thiện Hoàng

Thanks for your help! But I have tried that too 😅 I guess I will just stick to Vercel for Frontend and Render for only Backend 😁

Collapse
 
ankitbisen28 profile image
Ankit Bisen

it's worked for me thank you....

Collapse
 
freelancernizamc profile image
Md Nizam Uddin

Good job but If i create 4 page website by tailwind, how can i solve this problem? Please help. In netlify only index.html file show.

Collapse
 
jalalbmnf profile image
jalalbmnf

Thank you

Collapse
 
developeratul profile image
Minhazur Rahman Ratul

I was getting the same issue on Vercel and found your article as a solution.
Thank you!

Collapse
 
samareshdas profile image
Samaresh Das

Thanks mate, you're a life saver. After building a whole MERN stack project I was stuck on this for so long

Collapse
 
sadik_farhan profile image
Farhan Sadik

in vercel.json ->
{
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}

it also worked for me <3

Collapse
 
ashishkuldeep23 profile image
Ashish kuldeep

That was a very useful post bro, thank you so much. I faced the same problem and I used hashBrowserRouter to solve the problem but your solution is great.

Collapse
 
cashtag7_33 profile image
Md. Noman Ebeny Shahid

thank u brother