Current VS Expected behavior
Expected Behavior:
When visiting https://acme-old-site.com or https://www.acme-old-site.com, it should perform a permanent (301) redirect to https://acme-new-site.com/products (preserving any subpaths). For example:
https://acme-old-site.com/bookingshould redirect tohttps://acme-new-site.com/products/booking.
Current Behavior:
The redirect is not occurring as expected. Instead, when accessing https://acme-old-site.com:
- It currently serves content directly from
acme-new-site.com/productsbut the URL in the browser remainshttps://acme-old-site.com. There is no 301 redirect detected byhttpstatus.io. - (Alternatively, if this is what you are seeing): It redirects to
https://acme-new-site.com(the base domain) instead ofhttps://acme-new-site.com/products.
vercel.json configuration:
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"redirects": [
{
"source": "acme-old-site.com/(.*)",
"destination": "https://acme-new-site.com/products/$1",
"permanent": true
},
{
"source": "www.acme-old-site.com/(.*)",
"destination": "https://acme-new-site.com/products/$1",
"permanent": true
}
]
}
Project information (URL, framework, environment, project settings)
Project Settings:
- Root Directory: Configured as
packages/ui(in Project Settings > General). - Domain Assignment: Both
acme-old-site.comandwww.acme-old-site.comare “Assigned to Production” in Project Settings > Domains. All UI-based domain redirects for these domains have been explicitly removed. next.config.mjs: Theredirects()function has been completely removed frompackages/ui/next.config.mjsto avoid any conflicts.- DNS: DNS for
acme-old-site.comandwww.acme-old-site.comis pointing to Vercel’s nameservers (ns1.vercel-dns.com,ns2.vercel-dns.com) and has been confirmed as fully propagated globally viawhatsmydns.net. - Deployment Status: The latest deployment, containing all the above configurations, has been successfully promoted to production and is marked “Ready”.
Troubleshooting Steps I’ve Already Taken (Extensive):
- Performed multiple project redeployments, including “Clear Build Cache” each time.
- Aggressively cleared browser cache, cookies, and OS DNS cache on multiple devices and browsers (including incognito mode and different networks).
- Verified the exact content and presence of the
vercel.jsonfile in the deployed source (via Vercel’s “Source” tab for the active production deployment). - Confirmed that the correct branch (with all fixes) has been promoted to the active production deployment.
- Attempted alternative
sourcevalues invercel.json(e.g., usinghasproperty), but reverted to the standard, correct format after no success. - Tried implementing redirects via
next.config.mjs, but encountered build errors becausesourcedoes not accept domain names, confirmingvercel.jsonis the correct method for this specific cross-domain source redirect.
Given all these exhaustive checks, it appears the redirect rule in vercel.json is not being applied at Vercel’s edge network for acme-old-site.com as expected.