API 404 on Custom Domain (jobseekzm.com) - Works on Previews

My Vercel Project Name: Pits Mapate’s projects
My Custom Domain: https://jobseekzm.com/
The API Endpoints experiencing 404s: https://jobseekzm.com/api/jobs and https://jobseekzm.com/api/career-hub
The exact 404 Response I am seeing:
The page could not be found NOT_FOUND cpt1::52zzq-1752936760270-c833d90e96b8
Confirmation that the API works on the Vercel preview URL: https://vercel.com/pits-mapates-projects/job-seek-zm/7KV5GVnriGAd4h2P7915HdgdVZ7x logs for those requests show 200 OK.
My vercel.json file content
{
“rewrites”: [
{ “source”: “/api/(.)", “destination”: “/api/index.js” },
{ “source”: “/sitemap.xml”, “destination”: “/api/index.js” },
{ “source”: "/(.
)”, “destination”: “/” }
],
“builds”: [
{
“src”: “frontend/package.json”,
“use”: “@vercel/static-build”,
“config”: {
“distDir”: “dist”,
“installCommand”: “cd frontend && npm install”
}
},
{
“src”: “api/index.js”,
“use”: “@vercel/node”

}

],

“cleanUrls”: true,
“trailingSlash”: false
}

My project’s directory structure: api/index.js (backend) at root,
frontend/
Directories - .vercel; dist; node_modules; public; src;
Files - .env; .gitignore; eslint.config.js; index.html; package.json; package-lock.json; vite.config.js

Framework Preset: Other
Root Directory: Empty (.)
Steps I have already taken: Multiple redeploys, including clearing the build cache and attempting vercel --prod --force.

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.

:tada: SOLVED!

The issue was my deployment directory. I was deploying from:
desktop/JobSeekZM/frontend/

Instead of the correct root directory:
desktop/JobSeekZM/

This meant my API folder wasn’t included in the deployment, causing 404s on the custom domain while preview URLs worked.

Key lesson: Always deploy from the directory that contains BOTH your frontend AND api folders.

Thanks for the help everyone