Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Checkout redirects to wrong domain: how to find and fix it

CNV-193High impactDetectedBy FunnelGuardPublished Updated
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.

Where a wrong-domain redirect breaks the journey
  1. Product pageOn www.example.com
  2. Add to cartCart works
  3. Click CheckoutRedirects to staging.example.com
  4. PaymentEmpty cart or error
  5. Purchase eventNot attributed

The shopper leaves your domain at checkout, so everything after that is lost or unattributed.

Orders completed before and after the redirect appearedExample numbers
Orders completed before and after the redirect appeared (example)Before redirect: 120 orders per week; After redirect: 35 orders per week0469212035Before redirectAfter redirectorders per week

Example: illustrative numbers showing how a wrong-domain redirect can cut completed orders.

How to check if your site has it

Check the checkout hostname yourself
  1. Open a private window

    Use a fresh browser session with no logins or cached redirects.

  2. Run the journey

    Add a product to the cart and click Checkout. Watch the address bar at each step.

  3. Compare the domain

    Note the host in the address bar. It should be the one you intend, with no staging, old or unexpected host.

  4. Trace the redirects

    Run the command below, or open the browser DevTools Network tab with Preserve log on, and read each Location header.

  5. 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.

Follow redirects and print each hopbash
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.

Fix by platform
  1. 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_HOME and WP_SITEURL in wp-config.php, which override these.

  2. Check WooCommerce pages

    Under WooCommerce > Settings > Advanced, confirm the Cart and Checkout pages are set, and open each page to check its permalink.

  3. 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.

  4. Review redirect plugins

    Check redirect or SEO plugins and your caching or CDN rules for entries pointing at the wrong host, then clear caches.

Example: redirect old host to the correct onenginx
server {
  listen 443 ssl;
  server_name old.example.com;
  return 301 https://www.example.com$request_uri;
}

How to confirm it's fixed

Confirmation checks
  • 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

Prevention habits
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: redirects / assert URL.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.