On this page
What this issue is
A shopper clicks Checkout or Buy now and lands on a different domain from the one they expected. It might be a staging copy (staging.example.com), a retired domain, a myshopify.com address, or a www versus non-www mismatch. Sometimes the new domain is meant to be there, like a hosted payment page. The problem is when it is not, or when it is not set up to match your brand and tracking.
Why it costs you leads or sales
Shoppers who see an unfamiliar domain, a certificate warning or a page that looks different often leave. Some destinations simply fail: a staging site may be password protected or have no products, so the cart is empty. Tracking also breaks. Cookies are tied to a domain, so the session, the ad click ID and the purchase event can be lost when the host changes, and your ad platforms see fewer sales than you made.
- Product pageOn www.example.com
- Add to cartCart works
- Click CheckoutRedirects to staging.example.com
- PaymentEmpty cart or error
- Purchase eventNot attributed
The shopper leaves your domain at checkout, so everything after that is lost or unattributed.
Example: illustrative numbers showing how a wrong-domain redirect can cut completed orders.
How to check if your site has it
Open a private window
Use a fresh browser session with no logins or cached redirects.
Run the journey
Add a product to the cart and click Checkout. Watch the address bar at each step.
Compare the domain
Note the host in the address bar. It should be the one you intend, with no staging, old or unexpected host.
Trace the redirects
Run the command below, or open the browser DevTools Network tab with Preserve log on, and read each Location header.
Test other entry points
Repeat from mobile, from the cart page, from a Buy now button and from an ad landing page with UTM parameters.
curl -sIL -o /dev/null -w '%{url_effective}\n' https://www.example.com/checkout
# See every Location header
curl -sIL https://www.example.com/checkout | grep -i '^location'How to fix it
First decide which domain should be the final checkout host. Then find the single place that sends shoppers elsewhere. The fix depends on your platform.
Check the site addresses
Go to Settings > General and confirm WordPress Address (URL) and Site Address (URL) show the correct live domain. Also check
WP_HOMEandWP_SITEURLin wp-config.php, which override these.Check WooCommerce pages
Under WooCommerce > Settings > Advanced, confirm the Cart and Checkout pages are set, and open each page to check its permalink.
Replace old URLs
After a migration, run a database search and replace of the old domain with the new one using a tool such as WP-CLI
wp search-replace. Take a backup first.Review redirect plugins
Check redirect or SEO plugins and your caching or CDN rules for entries pointing at the wrong host, then clear caches.
Set the primary domain
Go to Settings > Domains and make sure the domain you want is set as Primary. Check that other domains redirect to it.
Check checkout domain
Open Settings > Domains and look for any separate checkout or subdomain settings, and any third-party apps that host their own checkout.
Search theme links
In Online Store > Themes > Edit code, search for hardcoded old domains or
myshopify.comin cart and button templates.Check URL redirects
Under Content > Menus > View URL Redirects (or Online Store > Navigation), remove redirects that point to the wrong host.
Look for redirecting tags
In Tags, check Custom HTML tags for code that sets
window.locationor rewrites links to another domain.Check linker settings
If checkout is intentionally on another domain, configure cross-domain measurement in your GA4 settings so sessions carry over.
Test in Preview
Use Preview mode to see which tag fires just before the redirect, then fix or pause it.
Check the default domain
In Project settings > Hosting, confirm the correct domain is set as default so others redirect to it.
Check button links
Inspect Checkout and Buy buttons in the Designer and replace absolute links that point at the old or staging host.
Check 301 redirects
In Hosting > 301 redirects, remove any rule that sends checkout paths to another domain, then republish.
Check funnel domain
In Sites > Funnels, open the funnel's Settings and confirm the right domain is attached to the checkout step.
Check step paths and buttons
Open the order form step and check any buttons or redirect URLs pointing at an old domain.
Review custom domains
In Settings > Domains, make sure the domain is verified and not still linked to a different funnel.
Check the primary domain
In Domains, make sure the domain you want is set as primary and others are connected to redirect to it.
Check button links
In the Editor, check cart and checkout buttons for absolute links to an old address.
Check redirect manager
In SEO tools > URL Redirect Manager, delete rules that send checkout paths to the wrong host.
Set the primary domain
In Settings > Domains, choose the correct domain as primary so others redirect to it.
Check URL mappings
In Settings > Developer Tools > URL Mappings, remove rules pointing checkout paths at another host.
Check code injection
In Settings > Developer Tools > Code Injection, look for scripts that change
window.location.
Find the redirect source
Trace hops with curl, then search the server config (nginx, Apache .htaccess), app code and environment variables for the wrong host.
Fix base URL settings
Correct the app's base URL or APP_URL and any payment return URLs (success and cancel) in your environment config and payment provider dashboard.
Use relative links
Prefer relative paths for internal checkout links so they cannot point to a stale host.
server {
listen 443 ssl;
server_name old.example.com;
return 301 https://www.example.com$request_uri;
}How to confirm it's fixed
- A fresh private window goes from cart to checkout on the intended host.
- The curl redirect trace shows no hop to staging, old or unexpected domains.
- Checkout works from mobile, Buy now buttons and ad links with UTM parameters.
- Payment success and cancel pages return to the correct domain.
- The purchase event shows up in your analytics test or real-time view.
How to prevent it happening again
- After any migration, clone or domain change, search the database and theme for the old host.
- Keep staging sites blocked from sending live shoppers and use separate URL settings per environment.
- Keep one primary domain and redirect all others to it.
- Review redirect rules and payment return URLs whenever you change domains.
- Run an automated checkout check on a schedule rather than relying on manual tests.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your checkout journey on a schedule, follows the redirects, and asserts the URL at the step, so it notices when the checkout ends up on a host other than the one you expect. If a check fails, it is re-checked from a second region before one alert goes out with a screenshot and a likely cause, by email, Slack, Teams, WhatsApp, webhook or PagerDuty.
Test traffic is marked (utm_source=funnelguard, fg_test=1) and stops before payment unless your store's test mode is set up. You can start on the Free plan (1 site, 2 journeys, daily checks, no card), and paid plans include a 3-day free trial.
Questions people ask
Why is my checkout redirecting to the wrong domain?
Usually a store URL setting, a hardcoded link, or a redirect rule still points at a staging, old or alternate host. This often appears after a migration, a clone or a domain change. Trace the redirect hops to find which one changes the host.
Why does my checkout go to my staging site?
A staging copy often keeps live URLs, or the live site picked up the staging address during a push or database copy. Check the site URL settings, search the database and theme for the staging host, and clear caches.
How do I find which redirect is sending shoppers to another domain?
Run curl -sIL on your checkout URL and read each Location header, or use the browser DevTools Network tab with Preserve log enabled. The first hop that changes the host is the one to fix.
Is it bad if checkout is on a different domain?
Not always. Hosted checkouts and payment providers can use their own domains. It becomes a problem when the domain is unexpected, looks untrusted, or breaks your cookies and tracking, so set up cross-domain tracking and correct return URLs.
Will a wrong-domain checkout affect my ad tracking?
Yes, it can. Cookies and session data are tied to a domain, so the ad click ID and purchase event may not carry over. Your ad platforms may then report fewer sales than you actually made.
Does www versus non-www cause checkout problems?
It can. Carts and sessions are stored per host, so moving from www to non-www can empty the cart or log the shopper out. Pick one primary domain and redirect the other to it.
How can I be alerted if my checkout redirects to the wrong domain?
FunnelGuard runs your checkout journey on a schedule, follows the redirects and asserts the URL. If it lands on an unexpected host, it re-checks from a second region and sends one alert with a screenshot and a likely cause.
Related issues
- CNV-186Checkout page fails to loadFix guide
- CNV-194Checkout session expires too fastFix guide
- CNV-195Express checkout (Shop Pay) button breaks normal flowFix guide
- CNV-196Checkout shows 'store unavailable' or password pageFix guide
- CNV-197Checkout extension/app error message shownFix guide
- CNV-191Order summary differs from cartFix guide