How to Find and Read a Website's robots.txt
Find robots.txt at a website root, fetch and save the file, read User-agent, Allow, Disallow and Sitemap, and distinguish crawling from indexing.

Like it ? share it
A site's robots.txt lives at the root of its host, such as https://www.enfect.com/robots.txt. It tells cooperating crawlers which paths they may fetch. You can open the file in a browser or read it with FetchRobotstxt.
Running a few hobby sites in my spare time, I have found that keeping track of crawlers can feel like herding cats. Reading the actual file is a useful first check when a crawler behaves differently from what you expected.
Find the right file
Take the site's scheme and host, then add /robots.txt. For a page at https://example.com/blog/article, the file is at https://example.com/robots.txt, not inside the article directory.
Hosts and schemes matter. www.example.com and example.com can serve different files, as can HTTP and HTTPS. Inspect the version that corresponds to the URLs you are troubleshooting.
To use the tool:
- Open the robots.txt reader.
- Enter a complete address, such as
https://www.enfect.com/. - Select FETCH ROBOTS.TXT.
- Read the returned text, then use COPY or DOWNLOAD to keep a copy for comparison.
The tool constructs the root robots.txt address from your input and follows redirects when fetching it. It shows the file and its line and character counts. It does not automatically decide whether an arbitrary page URL matches a crawler's rules.

This screenshot was captured from the live tool on October 8, 2026. A site's file can change; fetch it again when investigating a current problem.
Procedure: start with the complete page URL
- Record the complete URL of the affected page.
- Keep its protocol, host, and port.
- Replace the path with
/robots.txt. - Remove the query and fragment from this file address.
- Keep the original page URL for the subsequent rule test.
The protocol is http or https. The host is the name such as www.example.com. A port can appear after the host, as in :8443.
A query starts with ?. A fragment starts with #. This procedure removes them only from the robots.txt address.
The original page query remains necessary for a path rule test.
Eight address examples
On November 12, 2026, we ran eight offline examples with Node.js 24.14.1 on Windows.
| Page URL | Constructed robots.txt address |
|---|---|
https://example.com/blog/post?ref=x#part |
https://example.com/robots.txt |
https://example.com/blog/robots.txt |
https://example.com/robots.txt |
http://example.com/blog/post |
http://example.com/robots.txt |
https://www.example.com/blog/post |
https://www.example.com/robots.txt |
https://blog.example.com/post |
https://blog.example.com/robots.txt |
https://example.com:443/post |
https://example.com/robots.txt |
https://example.com:8443/post |
https://example.com:8443/robots.txt |
http://example.com:80/post |
http://example.com/robots.txt |
This expression constructs each address:
const robots = new URL('/robots.txt', pageURL);For each example, the test compared the output with the expected address. It also compared the origin of the two URLs.
An origin identifies the protocol, host, and effective port. All 16 assertions passed. Two runs produced identical output.
The test made no network requests. It did not establish that these addresses serve a file, or that a crawler uses it.
Google's scope examples distinguish protocols, hosts, and ports. HTTPS port 443 and HTTP port 80 are the respective defaults. A different port needs a separate check.
A file at /blog/robots.txt does not establish separate crawl rules for that directory. RFC 9309, section 2.3, specifies the root file address.
A redirect needs two address records
A robots.txt request can redirect to another host. The final address alone does not identify the original scope.
RFC 9309, section 2.3.1.2, specifies the initial authority as the context for rules retrieved within five redirects.
For example, a request for https://shop.example.com/robots.txt can redirect to https://example.com/shop-rules.txt.
Under that rule, the retrieved file applies to the initial shop authority. Its final location does not expand that scope to every host.
This is a specification example. Our offline experiment did not test redirects or crawler behavior.
Procedure: keep the retrieval evidence
- Record the initial robots.txt address.
- Record the final address after any redirects.
- Record the response status and retrieval time.
- Keep the response text.
- Compare the original page address with the recorded scope.
The Enfect robots.txt reader provides file text for inspection. It does not calculate crawl permission for each page.
A Search Console discussion reports confusion about several host and protocol variants. A separate discussion describes a root file and a file inside a blog directory.
These reports identify questions to investigate. They do not prove the cause of a problem on your site.
The file version guide explains the next comparison with Google's retrieved copy. A correct address alone does not prove crawl permission or indexing.
Read the directives
Here is a fictional example to practise with, rather than a claim about Enfect's current rules:
User-agent: *
Disallow: /private/
Allow: /private/help.html
Sitemap: https://example.com/sitemap.xml| Directive | Meaning in this example |
|---|---|
User-agent: * |
This group applies to crawlers without a more specific matching group |
Disallow: /private/ |
Requests crawlers in this group to avoid that path |
Allow: /private/help.html |
Allows this more specific path within the otherwise blocked directory |
Sitemap: |
Gives the absolute address of a sitemap |
For Google, a more specific matching user-agent group takes precedence over the wildcard group. Within the selected rules, the most specific matching path wins; an equally specific Allow takes precedence over Disallow. Path matching is case sensitive. See how Google interprets robots.txt before applying a rule to a complicated URL.
Do not read a Disallow line in isolation. First identify the crawler's group, then check the URL path against that group's Allow and Disallow rules. Other crawlers can support different extensions or choose not to cooperate.
robots.txt Letter Case: Keep the Path Values
Procedure: keep the original path values
- Keep a copy of the original robots.txt file.
- Record the complete page URL.
- Record the crawler name.
- Find the applicable user-agent group.
- Compare each path value with the original URL.
- Keep uppercase and lowercase letters in those values.
Do not convert the complete file to lowercase as a format correction.
A field name appears before the colon. Its value appears after the colon. These parts have different rules for letter case.
A field name differs from its value
For Google, Disallow, DISALLOW, and disallow identify the same field. However, /Private/ and /private/ are different path values.
The user-agent field name and its crawler value ignore letter case. Thus, Googlebot and googlebot identify the same crawler for this check.
Google's syntax reference describes these distinctions.
RFC 9309, section 2.2.1 requires group selection without regard to letter case. Section 2.2.2 recommends case-sensitive path comparisons.
This example uses one group and one path rule:
User-agent: Googlebot
Disallow: /Private/Changing only Disallow to DISALLOW keeps the path value. Changing the complete file to lowercase also changes /Private/ to /private/.
Eight offline checks
On November 15, 2026, we tested four file variants against two paths with Python 3.12.6 on Windows.
The experiment used the standard-library urllib.robotparser parser. Each check used the crawler name Googlebot.
| File variant | /Private/report |
/private/report |
|---|---|---|
| Original example | Blocked | Allowed |
| Uppercase field names only | Blocked | Allowed |
| Mixed case in field names and crawler value | Blocked | Allowed |
| Complete file converted to lowercase | Allowed | Blocked |
All eight assertions passed. Two runs produced identical output. The last row changed both results because the path value changed.
These are selected ASCII examples. The experiment made no network requests. It did not test Googlebot or Enfect's deployed software.
The tests do not cover wildcards, rule priority, duplicate groups, or percent encoding. They do not establish how a server handles different URL spellings.
The file address is a separate check
RFC 9309, section 2.3 specifies /robots.txt in lowercase at the service root.
A readable /Robots.txt address alone does not establish the response at /robots.txt. The original file address and the path values inside it need separate checks.
A webdev discussion asks about an uppercase letter in the filename. A TechSEO discussion separates field spelling from path examples.
These historical discussions identify questions. They do not establish a rule for every server or prove the cause of a current error.
Procedure: compare results before a change
- Make a test list with the actual URL spellings.
- Record the intended crawl permission for each URL.
- Compare the results for the original and proposed files.
- Review each changed result before approval.
The Enfect robots.txt reader retrieves file text for inspection. It does not calculate permission for each page.
The group selection guide explains the group check. A correct local result does not prove a later crawl or index change.
robots.txt Comments: Check the Rule Before
Procedure: inspect the rule before a change
- Keep a copy of the served robots.txt file.
- Find the applicable user-agent group.
- Find the first
#character on each rule line. - Read the path value before that character.
- Compare that value with the intended restriction.
- Test the intended paths before approval.
The # character starts a comment in robots.txt. This rule does not require a space before the character.
Thus, Disallow: /#! has the path value /. The text after # does not make this a restriction for one fragment.
A short comment can leave a broad rule
This fictional file has one group and one rule:
User-agent: *
Disallow: /#!After the comment starts, only / remains as the path value. In this file, that rule restricts the root and other paths.
Google's syntax reference explains comments and empty path values. RFC 9309, section 2.2.3 defines # as a comment marker.
An empty value gives a different result. In Disallow: # review, no path value remains. Google ignores a rule without a path.
These examples do not determine the result for every file. Group selection and other applicable rules remain necessary checks.
Four files, three paths
On November 17, 2026, we tested four independent files with Python 3.12.6 on Windows.
Each file contained User-agent: * and one rule. The experiment used urllib.robotparser and the fictional crawler name ExampleBot.
| Rule in the file | / |
/public/page |
/private/report |
|---|---|---|---|
Disallow: /#! |
Blocked | Blocked | Blocked |
Disallow: / # review |
Blocked | Blocked | Blocked |
Disallow: /private/ # review |
Allowed | Allowed | Blocked |
Disallow: # review |
Allowed | Allowed | Allowed |
All 12 permission checks passed. Four separate URL component checks also passed. Two runs produced identical output.
The experiment made no network requests. It did not test Googlebot, Enfect's deployed software, or changes in search results.
The samples do not test wildcards, rule priority, duplicate groups, or percent-encoded path comparisons.
A URL fragment is a separate component
In https://example.com/#!, the path is / and the fragment is !. A URL fragment does not become a robots.txt path rule.
RFC 3986, section 3.5 separates the fragment before resource access. Our URL checks used urlsplit() to inspect those components.
The sample https://example.com/%23! kept /%23! as its path and had no fragment. This is a different URL representation.
Changing # to %23 is not a general correction for a rule about fragments. The actual page URLs and intended restrictions need review.
A TechSEO discussion reports concern after a rule for /#!. A second discussion asks about hashbang URLs.
These historical reports identify questions. They do not prove a cause for traffic changes or establish present crawler behavior.
Procedure: compare the full file
- Make a list of paths that must have crawl permission.
- Make a list of paths that must not have crawl permission.
- Test both lists with the original file.
- Test both lists with the proposed file.
- Review each changed result before approval.
The Enfect robots.txt reader retrieves file text for inspection. It does not calculate permission for each page.
The group selection guide explains the group check. A local permission result does not prove a later crawl or index change.
Which robots.txt Rule Applies to a URL?
For Google, use the longest rule path that matches the URL in the applicable group. If matching Allow and Disallow rules have the same length, use Allow.
Google's rule documentation gives the order of priority. RFC 9309, section 2.2.2 measures specificity in octets and recommends Allow for equivalent rules.
Find the rule for one URL
- Record the full page URL.
- Record the crawler name.
- Get a copy of the robots.txt file with the Enfect robots.txt reader.
- Find the applicable rules with the user-agent group procedure.
- Make a list of the rules that match the URL.
- Compare the lengths of their path values.
- Record the rule that Google uses.
- Do the same procedure for a second URL in the same directory.
Use the reader to get the file text. Use the procedure to find the rule for a page URL.
Compare the path values
For the fictional path /staff/help/guide, these two rules match in the same group.
User-agent: Googlebot
Disallow: /staff/
Allow: /staff/help/Google uses Allow: /staff/help/ for that path. The Allow path is longer. For /staff/guide, only Disallow: /staff/ matches.
The next examples use one group and plain ASCII path values.
| Rules in the group | Page path | Rule that Google uses |
|---|---|---|
Allow: / and Disallow: /staff/ |
/staff/guide |
Disallow: /staff/ |
Disallow: /staff/ and Allow: /staff/help/ |
/staff/help/guide |
Allow: /staff/help/ |
Disallow: /staff/ and Allow: /staff/ |
/staff/guide |
Allow: /staff/ |
A TechSEO discussion asks why Allow: / does not give crawl permission to a path with a longer Disallow rule. A tester developer's post describes the same difficulty with rule order.
Compare the result from a local parser
We ran 12 offline checks with Python 3.12.6. We used the three rule pairs in both orders. For each pair and order, we used the target path and the control path /public/notes.
In these tests, Python's urllib.robotparser used the first rule that matched. The target result changed when we reversed the two lines. The control result stayed the same in all six checks.
| Target example | Documented Google result | Python with Allow first | Python with Disallow first |
|---|---|---|---|
| Longer Disallow path | No permission | Permission | No permission |
| Longer Allow path | Permission | Permission | No permission |
| Equal path values | Permission | Permission | No permission |
Three of the 12 local results differed from the results we expected from Google's documentation. Two runs gave the same output.
The Google results in the table come from its documentation. The test ran only the Python parser. The test data had one group and plain ASCII paths. For rules with special characters, see Google's path examples.
If the file cannot be fetched
| Outcome | What you know | Next check |
|---|---|---|
| File text returned | This request fetched a file | Read its rules and confirm you used the intended host |
404 |
There was no robots.txt at that address | Check the host and path; Google generally treats a missing file as having no crawl restrictions |
403 |
This request was refused | Compare a direct browser request and inspect firewall or access settings |
| Server error or timeout | The file could not be retrieved in this attempt | Retry and investigate the server or network |
The tool's error describes its own request. It does not prove that Googlebot received the same response. Google handles most 4xx robots.txt responses differently from 429, server errors and network failures; the official response-handling rules explain those distinctions.
robots.txt Errors: Keep the Status with the File
Procedure: record the response before a rule change
- Record the complete robots.txt address.
- Record the request time and timezone.
- Record the HTTP status code.
- Keep the response body without changes.
- Record the final address after any redirects.
- Compare this record with the error in Search Console.
The response body is the text that the server returns. The HTTP status code is a separate part of the response.
The Enfect robots.txt reader can retrieve file text through Enfect's server. Its result describes that request. It does not establish Google's response.
A 403 is not a Disallow rule
For a robots.txt request, Google's response rules distinguish these outcomes:
| Response | Google's documented treatment |
|---|---|
| 200 | Process the supplied rules |
| 403 or 404 | Assume no robots.txt crawl restrictions |
| 429 | Exception to the ordinary 4xx treatment |
| 503 | Use the server-error procedure |
| DNS or network failure | Treat the failure as a server error |
The 403 row applies to the robots.txt request. It does not give Google access to a protected page.
A 403 response is therefore unsuitable as a robots.txt method to reduce Google's crawl rate. The 429 exception also prevents a general “all 4xx are equivalent” conclusion.
For server errors, Google initially stops site crawls for 12 hours while it retries the file. It then uses the last good version for the next 30 days, if available.
Without that cached version, Google assumes no crawl restrictions during this subsequent phase. The official table describes later behavior according to site availability. These periods are not recovery promises.
RFC 9309, sections 2.3.1.3–2.4, distinguishes an unavailable file from an unreachable file. Its general rules permit access for the former and require complete disallow for the latter, with provisions for prolonged failures and caching.
Google's documentation gives its specific operational treatment. A generic status classification alone does not reproduce that process.
Five responses with identical text
On November 14, 2026, we ran a local HTTP experiment with Python 3.12.6 on Windows.
One server returned this same body with five different status codes:
User-agent: *
Disallow: /private/| Response status | Body equal to the test input? |
|---|---|
| 200 | Yes |
| 403 | Yes |
| 404 | Yes |
| 429 | Yes |
| 503 | Yes |
The client made five GET requests to the same local /robots.txt address. It recorded each status and body separately.
All five bodies had the same SHA-256 hash. All 16 assertions passed. Two runs produced identical output.
The server deliberately produced these responses. The experiment shows why file text alone cannot establish the response status.
It did not test Googlebot, caching, DNS failures, Enfect's deployed reader, or indexing. It did not measure how often these conditions occur.
A browser result does not identify the cause
A TechSEO discussion reports a readable file and a Search Console fetch error. The author later reported recovery but an uncertain cause.
In a separate SEO discussion, the author attributed recovery to removal of an old DNS record. These are user reports, without independent verification.
They support the need to compare observations. They do not establish one cause for all fetch errors.
Procedure: compare the records for your site
- Keep the complete Search Console error and its time.
- Find the corresponding request in your server records, if available.
- Compare its address and status with your saved response.
- Record any difference for the site administrator.
- After a correction, obtain a new response record.
If no matching server record exists, the cause remains unresolved. A new rule does not prove that Google can retrieve the file.
The file version guide explains the next comparison with Google's recorded copy. A later page crawl and search recovery need separate evidence.
Crawling, indexing and access are different checks
Robots.txt controls crawling. A blocked URL can still appear in Google if other pages link to it. Allowing a crawl also does not guarantee indexing. Google's robots.txt introduction explains both limits.
To keep a page out of search results, use a supported noindex directive in the page or HTTP response header and allow Google to fetch it so the directive can be read. Do not put noindex in robots.txt. For the full diagnosis, see why a page blocked by robots.txt can still be indexed.
Sensitive content needs authentication or another access control. Robots.txt is public, and a listed private path is still visible to anyone reading the file.
If you are investigating a sitemap address found in the file, continue with the sitemap audit guide. For crawler load or repeated fetch errors, compare the file with your server logs; the text alone cannot show how often a bot visited.