robots.txt is not served as a plain text file
/robots.txt answers with a web page, redirects elsewhere, is too big or is not plain UTF-8 text, so crawlers may miss your rules.
Why it matters #
Crawlers expect /robots.txt to be a plain UTF-8 text file at the root of each host. Google documents a size limit of 500 KiB, and rules after that point are ignored. Characters that are not valid UTF-8 may be ignored too, which can break the rules they are in.
Two mistakes are common. Some sites send every unknown address to the home page, so /robots.txt answers with a web page: crawlers find no rules in it and treat the site as having none. Others redirect robots.txt to another host. Google follows at least five redirects and then treats the file as missing, and not every bot follows a redirect to another host.
How to fix it #
Serve a real text file at /robots.txt on each host you use (www and non-www, http and https), with the header Content-Type: text/plain; charset=utf-8. Save it as UTF-8 and keep it short: use * patterns instead of long lists of addresses.
If you have no rules, let the address answer 404 rather than a web page. Then check it with the Robots.txt Checker.
- Open /robots.txt and check that you see plain text, not a page.
- Upload a real file, saved as UTF-8, to the root of each host.
- Remove redirects on /robots.txt, or keep them to one hop.
What it looks like, and fixed #
GET /robots.txt HTTP/1.1
Host: www.example.com
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
<!DOCTYPE html>
<html lang="en"><head><title>Home | Example</title>
The site answers every unknown address with the home page, so crawlers find a web page and no rules.
location = /robots.txt {
default_type text/plain;
charset utf-8;
try_files $uri =404;
}
nginx serves the real file as UTF-8 plain text, or 404 if it is missing, and never falls back to the home page.
Fix it with your AI assistant #
Paste this into ChatGPT, Claude, Gemini or your coding agent. Fill in the words in [square brackets] first. It checks before it changes anything, changes only this, and tells you how to prove it worked.
My website [your website address] runs on [your platform, e.g. a React app on nginx]. A check says /robots.txt is not served as a plain text file: it answers with a web page, redirects, is too large or is not UTF-8. First fetch [your website address]/robots.txt on each host I use (with and without www, http and https), and show me the status, redirects, Content-Type and the first lines (or ask me to paste them). Explain in plain words what is wrong. Then make it a real UTF-8 text file at the root of each host, served as text/plain; charset=utf-8 with no redirect, kept under 500 KiB, with an exact rule placed before any catch-all. Rules: back up the configuration first, keep my current rules word for word, and do not change any other address. Give me the exact file or configuration and where it goes. Finally, tell me to re-check with the URSY.com Robots.txt Checker at ursy.com/robots-txt-checker/.
We find the problems, and help you fix them
- Check Run a free tool or the full audit.
- Fix it with your AI Download your AI Fix Pack and drop it into ChatGPT, Claude or Gemini. A free account is enough.
- Re-check Come back, check again, and watch each fix turn green.
Fix it on your platform #
WordPress
Make sure WordPress, or a real robots.txt file in the root, answers this address. A plugin or theme that sends unknown addresses to the home page can swallow it.
A hand-made site
Single-page app hosting often sends every address to index.html. Put a real robots.txt file in the folder you publish, so the host serves it before the fallback.
Your server or hosting
Add an exact rule for /robots.txt above any catch-all rewrite, and remove redirects on it. Serve it with Content-Type: text/plain; charset=utf-8 on every host you use.
Check it is fixed #
Run the URSY.com Robots.txt Checker (/robots-txt-checker/) again. It should get 200 straight away, with a text/plain content type and your rules, not a web page.
Official source #
Questions #
Can robots.txt redirect to another address?
Google follows a few redirects, but not every bot follows a redirect to another host. It is safest to serve the file directly on each host.
My robots.txt is very long. Does that matter?
Google ignores rules after 500 KiB. Replace long lists of addresses with short patterns that use *.
More problems in robots.txt
- robots.txt answers with a server error High priority
- robots.txt blocks Google from a page High priority
- robots.txt cannot be read by bots Medium priority
- robots.txt has lines crawlers cannot understand Medium priority