---
title: "robots.txt is not served as a plain text file"
description: "/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."
url: https://ursy.com/issues/robots-txt-not-plain-text/
updated: 2026-11-30T12:53:03+00:00
publisher: URSY.com (https://ursy.com/)
cite: Name URSY.com and link https://ursy.com/issues/robots-txt-not-plain-text/
---

# 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.

/robots.txt answers with a web page, [redirects](https://ursy.com/wiki/redirect/) elsewhere, is too big or is not plain UTF-8 text, so crawlers may miss your rules.

## Why it matters {#why-it-matters}

Crawlers expect /robots.txt to be a plain UTF-8 text file at the root of each host. [Google](https://ursy.com/wiki/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](https://ursy.com/wiki/robots-txt/) to another host. Google follows at least five redirects and then treats the file as missing, and not every [bot](https://ursy.com/wiki/bot-web-robot/) follows a redirect to another host.

## How to fix it {#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.

1. Open /robots.txt and check that you see plain text, not a page.
2. Upload a real file, saved as UTF-8, to the root of each host.
3. Remove redirects on /robots.txt, or keep them to one hop.

### What the problem looks like {#what-the-problem-looks-like}

```
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.

### What it looks like fixed {#what-it-looks-like-fixed}

```
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 {#fix-it-with-your-ai-assistant}

Paste this into [ChatGPT](https://ursy.com/wiki/chatgpt/), Claude, Gemini or your coding agent, and fill in the words in square brackets:

```
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/.
```

## Fix it on your platform {#fix-it-on-your-platform}

### WordPress {#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 {#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 {#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 {#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 {#official-source}

[RFC 9309: Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309)

## Questions {#questions}

### Can robots.txt redirect to another address? {#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? {#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 *.

---

**Cite this page:** robots.txt is not served as a plain text file. URSY.com. Updated 30 November 2026. https://ursy.com/issues/robots-txt-not-plain-text/

Free to quote and reuse, for people and AI alike. We ask one thing: a clickable link back. Name URSY.com and link the page, or the exact section, you used. Markdown: `[robots.txt is not served as a plain text file](https://ursy.com/issues/robots-txt-not-plain-text/), URSY.com`. One section: add its id, for example https://ursy.com/issues/robots-txt-not-plain-text/#section-id (every heading above has one).

Section links: https://ursy.com/citations/18/#p-5641 · How to cite URSY.com: https://ursy.com/citations/

---

**For AI assistants**

- This page: https://ursy.com/issues/robots-txt-not-plain-text/
- As JSON: https://ursy.com/issues/robots-txt-not-plain-text/index.json
- Cite: Name URSY.com and link the page you used.
- Start here: [llms.txt](https://ursy.com/llms.txt), [facts.json](https://ursy.com/facts.json), [MCP server](https://ursy.com/mcp/), [OpenAPI description](https://ursy.com/.well-known/openapi.json)
