How to Fix "Redirect Error" & Redirect Loops in Search Console
'Redirect error' happens when Googlebot hits an infinite redirect loop, a chain exceeding 5 hops, a malformed destination URL, or a redirect cycling between HTTP/HTTPS or trailing slashes. Collapse every redirect into a single direct 301 hop.
Why Does This Issue Occur? (Symptom & Cause Matrix)
| Observed Symptom | Root Technical Cause | Recommended Fix |
|---|---|---|
| A → B → A infinite loop | Conflicting .htaccess & Next.js middleware redirects | Pick one single source of truth for trailing slashes and HTTPS |
| http:// → https:// → www → /slug/ | 3–4 sequential redirect hops | Redirect straight from any variant to final canonical URL in 1 hop |
Step-by-Step Fix Checklist
- 1
Trace Full Redirect Hops via curl -IL
Inspect every Location header from initial request to final HTTP 200 OK.
- 2
Align Edge CDN, Server & App Slash Rules
Ensure Cloudflare, Nginx/Apache, and Next.js agree on trailingSlash behavior.
- 3
Collapse Chains Into 1-Hop Rules
Point legacy URLs directly to the newest canonical slug rather than chaining through intermediate moves.
Single-Hop HTTPS + Non-WWW Rule (.htaccess)
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ https://yourdomain.com%{REQUEST_URI} [R=301,L]People Also Ask About This Error
How many redirect hops will Googlebot follow?
Google typically stops following after roughly 5 hops per crawl attempt; 0 or 1 hop is ideal.
Why does Next.js middleware loop with Cloudflare?
Usually Cloudflare Flexible SSL sends HTTP to the origin while Next.js forces HTTPS. Always use Cloudflare Full (Strict) SSL.