WordPress AI Connection Redirect Loop: HTTP, HTTPS and Canonical URL Checks
A redirect changes the scheme, host or path and may also discard authentication headers.
Trace every redirect and verify whether scheme, host, path and Authorization are preserved.
Likely causes
- A redirect changes the scheme, host or path and may also discard authentication headers.
- WordPress Home URL and Site URL use different schemes, hosts or paths.
- The browser uses HTTPS, but WordPress does not detect the request as secure at the origin.
- The client calls the wrong domain, base path, REST route or MCP endpoint.
- The hosting stack, reverse proxy, redirect or WAF removes the Authorization header before WordPress receives it.
Diagnostic sequence
- Trace every redirect and verify whether scheme, host, path and Authorization are preserved.
- Compare WordPress Home URL, Site URL, public canonical host and REST base address.
- Confirm that WordPress itself evaluates the request as HTTPS, not only the browser.
- Verify through sanitized server evidence that the Authorization header reaches WordPress.
- Confirm the exact scheme, host, base path and endpoint configured in the client.
- Record WordPress, plugin, client, connector and server versions before changing anything.
Apply the smallest correction
- Remove or correct the redirect that changes the authenticated request unexpectedly.
- Align Home URL, Site URL, public host, HTTPS scheme and REST base address.
- Correct trusted proxy and origin handling so WordPress reliably recognizes the original HTTPS request.
- Configure the trusted server or proxy path to pass the Authorization header to WordPress.
- Correct the client endpoint, transport, tool name or credential reference without broadening WordPress permissions.
Verify the result
- The authenticated request reaches the canonical endpoint without an unexpected redirect.
- Sanitized server evidence confirms that the Authorization header reaches WordPress.
- The authenticated request resolves to the intended dedicated WordPress user.
- The approved narrow read succeeds with a reproducible response.
What not to do
- Do not add an unverified permanent proxy workaround before confirming the trusted request path.
- Do not disable the WAF or security plugin globally to bypass one request.
- Do not edit WordPress core or third-party plugin files as the first troubleshooting step.
- Do not grant administrator access merely to make a connection test pass.
- Do not place an Application Password, Authorization header, token or cookie in a prompt, ticket, log excerpt or screenshot.
Related guides
- WordPress Home URL and Site URL Mismatch Breaks AI Connections
- WordPress Does Not Detect HTTPS Behind Cloudflare or a Reverse Proxy
- WordPress Authorization Header Is Missing or Stripped
- WordPress /wp-json/ Returns 404: REST API Diagnosis
- Troubleshooting Claude Code or Codex Access to WordPress
Sources and verification
This page was checked against the following primary sources. Last source review: .
- home_url() · WordPress Developer Resources
- site_url() · WordPress Developer Resources
- is_ssl() · WordPress Developer Resources
- RFC 9110: HTTP Semantics · RFC Editor