Hard refresh (CTRL + Shift + R) results in 404 #799
-
Hey. I seem to have a weird issue with my website. It's a static SPA that I deployed on Vercel. I have added the vercel.json file with rewrite config, so all requests are forwarded to the index.html file. {
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}
A website can be accessed fine when going to any URL. It also works fine if I reload it using CTRL + R, so the rewrite seem to work correctly. However when I do a hard reload with CTRL + SHIFT + R, Vercel returns a 404 not found page. Could anyone shed some light on what could be the reason for that and how it can be fixed? Here's the URL to the website https://novenaofpompeii.com/en/ Here's a gif of what happens |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Thomas solved this and shared the answer here: discussions/799#discussioncomment-3478065 🦸 Thanks for reaching out @ThomasFindlay! Confirmed I get the 404 error on first visit when I go to https://novenaofpompeii.com/en directly. The site does load if I go to https://novenaofpompeii.com first and let it redirect me, and it works if I refresh or visit the This seems like it could be related to the method you are using to redirect to |
Beta Was this translation helpful? Give feedback.
Thomas solved this and shared the answer here: discussions/799#discussioncomment-3478065 🦸
Thanks for reaching out @ThomasFindlay! Confirmed I get the 404 error on first visit when I go to https://novenaofpompeii.com/en directly. The site does load if I go to https://novenaofpompeii.com first and let it redirect me, and it works if I refresh or visit the
/en
version afterward. And hard refresh does result in the 404 again for https://novenaofpompeii.com/enThis seems like it could be related to the method you are using to redirect to
/en
. Are you able to share your repo or a minimal reproducible example? That would help me identify what's causing this problem for you.