How to Fix Redirect Loops: Diagnose and Resolve Circular Redirect Errors
Quick Summary
- What this covers: Identify and fix redirect loops causing browser errors and blocking search engine crawlers. Learn detection tools and resolution strategies for htaccess, Cloudflare, and CMS redirects.
- Who it's for: site owners and SEO practitioners
- Key takeaway: Read the first section for the core framework, then use the specific tactics that match your situation.
Redirect loops occur when URL A redirects to URL B, which redirects back to URL A (or through a longer chain eventually returning to the starting point), creating an infinite cycle that browsers and search engines cannot resolve. Users encounter "Too many redirects" errors while Googlebot abandons crawling pages caught in loops, effectively deindexing affected URLs. Sites with redirect loop issues see immediate traffic drops to affected pages and gradual domain authority erosion as search engines lose confidence in site reliability.
Understanding Redirect Loop Mechanics
Circular redirects emerge from conflicting redirect rules across multiple configuration layers.
Common Loop Scenarios
HTTP to HTTPS loop:
http://example.com → https://example.com (Server rule)
https://example.com → http://example.com (CMS rule)
This occurs when server-level HTTPS enforcement conflicts with application-level redirect logic attempting the opposite.
WWW canonicalization loop:
www.example.com → example.com (htaccess)
example.com → www.example.com (WordPress setting)
Competing canonicalization preferences between server configuration and CMS settings create this cycle.
Trailing slash loops:
/page → /page/ (htaccess adds slash)
/page/ → /page (CMS removes slash)
Different systems having opposite opinions about trailing slash usage generates endless redirects.
HTTPS + WWW combination loops:
http://www.example.com → https://example.com (forces HTTPS, removes WWW)
https://example.com → https://www.example.com (forces WWW)
https://www.example.com → https://example.com (removes WWW again)
Multiple redirect rules without proper sequencing create multi-step loops.
Browser Behavior
Modern browsers detect redirect loops after 20 redirects, displaying:
- Chrome: "ERR_TOO_MANY_REDIRECTS"
- Firefox: "The page isn't redirecting properly"
- Safari: "Too many redirects occurred"
- Edge: "This page isn't working"
Users can't access content, and browsers cache the error, requiring cache clearing even after fixes.
Search Engine Impact
Googlebot follows up to 5 redirect hops before abandoning a URL. Redirect loops cause:
- Immediate crawl failure for affected pages
- Deindexation within days as Google determines pages are inaccessible
- Crawl budget waste as Googlebot repeatedly attempts failed URLs
- Site quality signals deterioration if loops affect significant portions of the site
Google Search Console reports redirect errors under Coverage > Excluded > "Redirect error," showing specific URLs Googlebot couldn't access.
Diagnosing Redirect Loops
Multiple tools reveal redirect chains and identify where loops originate.
Browser Developer Tools Network Tab
Chrome DevTools shows redirect sequences:
- Open DevTools (F12)
- Navigate to Network tab
- Check "Preserve log"
- Attempt to load the problematic URL
The Network tab displays each redirect in sequence. Look for:
- Status codes: 301, 302, 307, 308 indicating redirects
- Location headers: Showing redirect destination
- Circular patterns: Same URLs appearing multiple times in sequence
If you see the same URL 5+ times with 30X status codes, you've confirmed a redirect loop.
Online Redirect Checker Tools
httpstatus.io: Enter any URL to see complete redirect chain:
- Lists each redirect hop with status codes
- Shows request/response headers
- Identifies loops with "circular redirect" warnings
redirectcheck.com: Similar functionality with visual representation:
- Color-coded status codes
- Highlights problematic redirects
- Exports redirect chain data
WhereGoes: Simplified interface showing:
- Final destination URL
- Number of redirects taken
- Loop detection with specific loop starting point
Command Line cURL
cURL provides detailed redirect information:
curl -I -L https://example.com
Flags:
-I: Show headers only-L: Follow redirects
Output shows each redirect hop. For loops, cURL eventually times out after 50 redirects.
More detailed analysis:
curl -I -L -v https://example.com 2>&1 | grep -E '(Location|HTTP/)'
This filters output to show only HTTP status lines and Location headers, making redirect chains easier to parse.
Screaming Frog SEO Spider
For site-wide redirect loop detection:
- Crawl your site with Screaming Frog
- Navigate to Response Codes tab
- Filter for "Redirect (3XX)"
- Check the "Redirect Chains" report under Reports menu
Screaming Frog identifies:
- All redirect chains site-wide
- Chains longer than 2 hops (potential problems)
- Redirect loops affecting multiple URLs
- Pages stuck in permanent redirect cycles
Google Search Console
Coverage Report under Index shows:
- "Redirect error" status for pages Googlebot couldn't crawl
- Specific URLs affected
- Validation options once fixed
URL Inspection Tool: Test individual URLs showing:
- Whether Google can access the page
- Redirect path Google encounters
- Any errors preventing indexation
Fixing Common Redirect Loop Causes
Resolution strategies depend on which system layer created conflicting rules.
.htaccess Rule Conflicts
WordPress .htaccess files commonly contain these sections:
# WordPress rewrite rules (auto-generated)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Custom redirects above WordPress rules can conflict. Proper structure:
# Force HTTPS first
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# Then force WWW (or non-WWW)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# Then WordPress rules
# WordPress section here...
Key principles:
- Place custom redirects BEFORE WordPress rules
- Use
[L]flag (Last) to stop processing after successful redirects - Order matters: HTTPS enforcement before WWW canonicalization
WordPress Settings vs. htaccess Conflicts
WordPress Settings > General defines:
- WordPress Address (URL)
- Site Address (URL)
These must match your desired canonical format (HTTPS, WWW preference) and align with server-level redirects.
Problem scenario:
- WordPress Settings:
https://example.com(no WWW) - .htaccess forces:
https://www.example.com(with WWW)
WordPress redirects all traffic to its configured URL, while htaccess immediately redirects back, creating a loop.
Solution: Ensure WordPress Settings match your server configuration preference. Both should enforce the same canonical URL format.
Plugin Redirect Conflicts
WordPress redirect plugins like Redirection or Simple 301 Redirects can conflict with server rules.
Diagnosis:
- Temporarily deactivate all redirect plugins
- Test if loop persists
- If loop resolves, reactivate plugins one by one to identify culprit
Resolution:
- Remove conflicting plugin redirects matching server-level rules
- Let server handle HTTPS/WWW canonicalization, use plugins only for content-specific redirects
- Check plugin settings for "automatically redirect to HTTPS" options that may conflict
Cloudflare SSL Settings
Cloudflare Flexible SSL creates HTTPS loops on sites with existing SSL certificates:
How Flexible SSL works:
- Visitor → Cloudflare: HTTPS connection
- Cloudflare → Server: HTTP connection
Loop creation: If your server has HTTPS redirect rules, it receives HTTP from Cloudflare and redirects to HTTPS, but Cloudflare sends HTTP again, creating infinite loop.
Solution: Switch Cloudflare SSL mode to Full or Full (Strict):
- Cloudflare Dashboard > SSL/TLS
- Change SSL mode from "Flexible" to "Full"
- Clear cache (Cloudflare dashboard > Caching > Purge Everything)
Full SSL: Cloudflare → Server uses HTTPS, matching visitor → Cloudflare connection.
Shopify Custom Domain Redirects
Shopify handles HTTPS automatically, but custom redirect rules in theme code can conflict:
Check theme.liquid for redirect code:
{% if request.host != 'www.example.com' %}
<script>
window.location.href = 'https://www.example.com{{ request.path }}';
</script>
{% endif %}
If Shopify's domain settings differ from this code's preferences, loops occur.
Solution: Remove custom redirect code from theme, let Shopify handle canonical URL configuration through Settings > Domains.
Server Configuration vs. Application Rules
Nginx configurations can conflict with application redirects:
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name example.com;
return 301 https://www.example.com$request_uri;
}
server {
listen 443 ssl;
server_name www.example.com;
# Main config
}
If application code (PHP, WordPress) also redirects from non-WWW to WWW, it processes after Nginx already handled it, potentially creating conflicts if rules aren't aligned.
Solution: Handle all canonical redirects at the server level (Nginx, Apache), disable application-level redirect logic for HTTPS/WWW canonicalization.
Clearing Cached Redirects
After fixing redirect loops, cached redirects can make problems appear persistent.
Browser Cache Clearing
Chrome:
- DevTools (F12) > Network tab
- Check "Disable cache" while DevTools is open
- Or Settings > Privacy and security > Clear browsing data > Cached images and files
Hard refresh: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac) bypasses cache for single page load.
Incognito/Private mode: Opens fresh browser session without cached redirects.
CDN Cache Clearing
Cloudflare:
- Dashboard > Caching > Purge Everything
- Or purge specific URLs under Custom Purge
Other CDNs:
- Check provider documentation for cache purge methods
- Most offer dashboard options or API endpoints for cache clearing
Google Search Console Validation
After fixing redirect loops:
- Navigate to Coverage report
- Select "Redirect error" issue
- Click affected URLs
- Click "VALIDATE FIX"
Google will recrawl affected URLs within days, updating index status once redirect loops are confirmed resolved.
Preventing Future Redirect Loops
Systematic practices prevent redirect loops from recurring.
Redirect Rule Documentation
Maintain a redirect inventory tracking:
- Source URL pattern
- Destination URL
- Redirect type (301, 302)
- Implementation location (htaccess, plugin, Cloudflare)
- Purpose/reason for redirect
This prevents conflicting rules added by different team members months apart.
Testing Protocol
Before deploying redirect changes:
- Test in staging environment replicating production configuration
- Use curl or redirect checker tools to verify redirect chains
- Check multiple URL patterns:
- HTTP and HTTPS versions
- WWW and non-WWW
- Trailing slash and no trailing slash
- Mobile and desktop URLs (if separate)
Redirect Rule Hierarchy
Establish clear hierarchy preventing conflicts:
Tier 1 (Server level - htaccess/nginx):
- HTTPS enforcement
- WWW canonicalization
- Trailing slash normalization
Tier 2 (Application level - WordPress, CMS):
- Should NOT handle Tier 1 redirects
- Configure to match Tier 1 preferences
Tier 3 (CDN - Cloudflare, Fastly):
- SSL mode matching server capabilities
- Edge redirects only for specific use cases
WordPress Site Health Check
WordPress 5.2+ includes Site Health checks:
Navigate to Tools > Site Health > Info > Server
Review:
- HTTPS status
- Site URL configuration
- WordPress URL configuration
Mismatches between configured URLs and actual server setup often indicate potential redirect loop risks.
Monitoring for Loop Reoccurrence
Automated monitoring catches redirect loops before they impact significant traffic.
Uptime Monitoring Services
Uptime Robot, Pingdom, StatusCake configured to check specific URLs can detect redirect loops:
- Configure alerts for "too many redirects" errors
- Test key page types (homepage, category pages, product pages)
- Set check frequency based on site update cadence
Google Search Console Monitoring
Review Coverage report weekly:
- New "Redirect error" issues
- Trends in redirect-related exclusions
- URLs dropping from index with redirect errors
Set up email alerts in Search Console for critical coverage issues.
Screaming Frog Scheduled Crawls
Weekly automated crawls checking:
- New redirect chains longer than 2 hops
- Redirect loops in recent content
- Changes in redirect pattern distribution
Export and compare reports identifying new problematic redirects before they accumulate.
Frequently Asked Questions
Can 302 redirects cause loops the same way 301s do?
Yes. The redirect loop mechanism is identical regardless of status code—302 (temporary), 301 (permanent), 307, and 308 can all create loops if configured to redirect circularly. The type of redirect doesn't prevent loops; only proper configuration does.
Will clearing my browser cache fix a redirect loop?
Only temporarily if the loop originates from browser-cached redirect instructions. If the server is actively creating the loop through misconfigured rules, clearing cache won't resolve it—you'll encounter the loop again on next page load once the browser follows the server's redirect instructions.
How do I fix a redirect loop if I can't access my WordPress admin?
Access your site via FTP or hosting control panel file manager. Rename your .htaccess file to disable it temporarily, or deactivate plugins by renaming the /wp-content/plugins/ folder. This lets you access admin to correct settings, then restore the renamed files.
Can SSL certificate issues cause redirect loops?
Indirectly, yes. Invalid or expired SSL certificates combined with HTTPS enforcement rules create error loops. Browsers attempt HTTPS connection, encounter certificate error, and if automatic HTTP fallback is configured, may redirect back to HTTPS, repeating the cycle.
Why does my redirect loop only affect certain pages?
Partial loops occur when redirect rules apply conditionally—perhaps only affecting pages matching specific patterns, or rules that conflict only in certain directory structures. Check if problematic pages share URL patterns and examine redirect rules specifically targeting those patterns.
How long does it take Google to re-index pages after fixing a redirect loop?
Google typically recrawls validated fixes within 3-7 days. Use Search Console's Validate Fix feature to prioritize recrawling. High-authority pages may be recrawled faster than low-priority content. Monitor Coverage report for status updates.
Can redirect loops affect my entire domain's rankings?
Widespread redirect loops signal site quality problems to Google, potentially impacting overall domain trust. However, localized loops affecting specific pages won't harm unaffected URLs. Fix loops promptly to prevent erosion of crawl budget and quality signals that could eventually have broader impact.
When This Fix Isn't Your Priority
Skip this for now if:
- Your site has fundamental crawling/indexing issues. Fixing a meta description is pointless if Google can't reach the page. Resolve access, robots.txt, and crawl errors before optimizing on-page elements.
- You're mid-migration. During platform or domain migrations, freeze non-critical changes. The migration itself introduces enough variables — layer optimizations after the new environment stabilizes.
- The page gets zero impressions in Search Console. If Google shows no data for the page, the issue is likely discoverability or indexation, not on-page optimization. Investigate why the page isn't indexed first.