Skip to content
Nazmul Nikhil
Menu

Robots.txt Has Too Many Redirects or Redirect Loop (Ahrefs)

Ahrefs flags a robots.txt that redirects too many times or loops. Crawlers may then treat your site as having no rules. Here's how to serve it directly.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
Robots.txt Has Too Many Redirects or Redirect Loop (Ahrefs)
Photo: Henry Schneider on Unsplash

In short

Ahrefs flags "Robots.txt has too many redirects or redirect loop" when fetching /robots.txt leads through several redirects or loops back on itself. Google follows at least five redirect hops for robots.txt; if it still can't reach the file, it treats it as not found, which means no crawl restrictions at all. Serve robots.txt directly (status 200) on your main host.

Robots.txt should load directly from the root of each host. Redirects there cause more trouble than on normal pages.

Check it

curl -sIL https://example.com/robots.txt | grep -iE "^(HTTP|location)"

One redirect from http:// or the non-preferred host to the main host is normal. More hops, or a loop, need fixing.

Common causes

Cause Fix
Chained HTTP → HTTPS → www → trailing-slash rules Combine into one redirect; robots.txt needs no slash
Conflicting CDN and server rules See "Redirect loop"
A catch-all rule redirecting unknown files to the home page Exclude /robots.txt from the rule
Robots.txt served by an app route that redirects Serve a static file instead

After fixing, check the robots.txt report in Search Console to confirm Google fetches it successfully.

This guide isn't affiliated with or endorsed by Ahrefs.

Sources and references

TAGSAhrefs Site AuditRobots.txt redirectRobots.txt redirect loopRobots.txt too many redirects
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with Technical SEO

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Site Audit Issues posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com