Hello everyone,
I’m hosting a project on Vercel, and I’m experiencing an issue where all pages redirect to the homepage when accessed directly through their URLs. For example:
- Navigating to
/about
or/contact
from the homepage works fine. - However, if I open
/about
or/contact
directly in a new browser tab or paste the URL, it redirects back to/
.
Here are some details about my setup:
- Framework: [Insert framework, e.g., Next.js, React, or Vite]
- Hosting: Vercel
- Domain: Custom domain connected through Vercel (DNS configured with
ns1.vercel-dns.com
andns2.vercel-dns.com
).
What I’ve tried so far:
- Verified DNS records: A record (
@
) points to76.76.21.21
, and CNAME (www
) points tocname.vercel-dns.com
. - Checked browser console and server logs: No specific errors related to routing or redirects.
- Reviewed the
vercel.json
configuration for potential rewrite or redirect rules that could be causing this behavior. - Ensured client-side routing and server-side logic are correctly configured.
The issue persists regardless of what I’ve tried.
Question:
Why is this happening, and how can I fix it so that pages load properly when accessed directly by URL? Are there specific configurations in Vercel I might be overlooking?
Any guidance would be greatly appreciated. Thank you!