What are the conventions of Disallow, asterisk, and dollar sign in robots.txt?

📅 2026-10-13 👁️ 19

What do Disallow, wildcard asterisk, and trailing dollar sign at the end of a line represent in robots.txt? This set of rules is defined by the standard document RFC 9309: The basic instructions are Allow and Disallow fields, which respectively indicate the paths to be allowed and disallowed for crawling; the asterisk is a wildcard, matching any segment of characters; the dollar sign at the end of the line indicates that the address matches exactly to this position. Understanding these conventions can cover most of the reading and writing needs for daily crawling rules.

The scope of the two basic instructions.

Allow and Disallow are both objects of 'user group + path prefix': files are segmented by user group (the most common wildcard crawler), and within each segment, declare which paths are allowed and which are prohibited. By default, paths that are not declared are unrestricted; Disallow points to a directory, meaning that all addresses with the prefix are excluded.

Two easily confused boundaries: The Disallow for null values means 'nothing is prohibited', that is, the entire user group can follow the convention of the entire site; when the same path is covered by both Allow and Disallow, the more precise (longer prefix) one takes effect, which is a clear matching idea in the standard, and has nothing to do with 'the one written first has priority.'

Standardization of wildcards and tail symbols

The asterisk solves the matching of 'indefinite length in the middle': For example, if you want to exclude all list pages with sorting parameters, you can use an asterisk to replace the parameter segment in the path. The dollar sign solves the 'stop here' exact matching: After adding a dollar sign at the end of the line, the rule only matches the address that ends at this position, and any longer address with any suffix is not affected. Combined, they can express the 'exclude bare directories without suffixes, while retaining their suffix pages' such fine-grained intentions.

Writing fragment Meaning Typical use
Disallow path Prohibit all addresses under this prefix Exclude background and internal tool directories
Allow path Explicitly allow a certain prefix Release individual public pages under prohibited directories
Asterisk Match any character sequence Override address segment with parameters
Dollar sign at the end of the line Address ends exactly here Only match bare addresses without query parameters

Note that the dollar sign only affects the end judgment, not the regular expression engine - if you want to write complex regular expression logic, you will be disappointed. The standard matching syntax only has these two types of wildcards with prefixes.

Why does it only constrain crawling, not inclusion?

robots.txt controls whether to crawl or not, regardless of whether it will be indexed after being crawled. Pages that have been prohibited from crawling may still appear in the index due to external links (the engine only indexes addresses and does not retrieve the text), which is the most common misunderstanding. To completely exclude a page from search results, you need to rely on page-level control or access permissions, not just write a line in robots.txt. Similarly, robots.txt is a gentleman's agreement and has no binding force on bulk collectors who ignore the agreement - to prevent content from being taken whole, you need to use other anti-crawling measures.

There is also a safety red line: do not hide sensitive background addresses in Disallow. Public files mean that the existence of this path has been announced to everyone, and exposing the entry is more likely to be targeted for testing. The protection of the background should be based on authorization and access control.

Where is the robots configuration entry and when to review it inside the site?

AnQiCMS supports robots configuration, the background modification is generated to the root directory of the site. There are two times to actively check the robots rules: one is after changing the pseudo-static rules - the address form has changed, the original exclusion rules written according to the path prefix may no longer match, or may inadvertently damage the public pages of the new format.After the structure adjustment of the column - the old prefixes that were excluded may have been replaced with new ones, and the rules may be disconnected from the actual route. The review method is very direct: take the rule list and compare it with the representative addresses in the current site map one by one, confirming that each Disallow still only blocks the intended address.

Common questions

How long does it take for the change of robots to take effect?It depends on the time when each engine next fetches the file, there is no immediate push; eager inclusion actions with link push are more effective than waiting for the file to be re-fetched.

Can different rules be written for different user group segments?Can, limit separately by engine user group, but verify the matching results of mainstream crawlers, to avoid only testing wildcard segments.

Where should the Sitemap declaration be written?It can be written in the robots file to point to the Sitemap address, which is to give it 'directions', and it does not conflict with allowing or blocking crawling.

Related articles

Writing nofollow in robots.txt actually does not take effect, which standards recognize which fields.

The standard text for excluding by robots, the fields only include User-agent and Disallow groups, nofollow is not defined in robots.txt, and it will not be parsed according to the standard. This article distinguishes between blocking crawling and blocking inclusion: crawling is controlled by robots configuration, inclusion is based on page-level control and server-side redirect convergence, and on-site robots settings and 301 redirect each have their own responsibilities.

2026-10-13

How to read the 'remain' and 'not_valid' fields after submitting the link to Baidu's push interface

According to Baidu Search Resource Platform documentation, when the API push is successful, it returns the four fields: success, remain, not_same_site, and not_valid: remain is the remaining quota for the day, and not_valid is the list of invalid links; when it fails, it returns client error codes starting with 4 or a 500 server error code. This article discusses the troubleshooting order by field and explains which part of the link push and sitemap covers the link inclusion path.

2026-10-13

The page engine for the newly published page is taking a long time to crawl, which part does the sitemap and IndexNow manage?

New pages are not indexed in time, first distinguish which part of the site map and IndexNow are responsible for the indexing chain: The site map provides a complete list and tells the engine what is on the site; IndexNow and similar real-time notification mechanisms are responsible for informing participating engines of content changes as soon as possible. Both complement each other, and full and incremental two chains need to be configured in the site to ensure the timeliness of indexing.

2026-10-13

What is the single file limit of the site map, and how to split it into index files when the URL exceeds ten thousand?

The number of entries and the volume limit of a single sitemap file are agreed upon by the protocol. When approaching or exceeding the limit, the file should be split into multiple sub-files and grouped using an index file, organized by category and update time. This article explains the limit from the sitemap protocol, how to split when exceeding the limit, and the method of supplementing the collection时效 through active push after splitting.

2026-10-13

The page has been changed, but the user still sees the old version. What order should be followed from clearing the cache to verification?

The content has changed, but the front-end is still showing the old page. Most of the time, it's not that the program hasn't taken effect, but rather that the intermediate cache layer is still hitting the old copy. Investigate in three steps: first, prove false on the source station and confirm that the change has really been saved to the database; then clear the cache at an appropriate granularity, with edge nodes supporting a variety of ranges such as address, domain name, tag, prefix, and the entire site; finally, check whether the cache status header in the response has changed from a hit to a source, and confirm that there is no trace of verification through the user side. Make a backup before making batch changes and keep a fallback.

2026-10-13

After the site-wide replacement changes the column name, should the anchor text and pseudo-static rules follow?

The site-wide replacement can change keywords and links in the main text in one go, but it only covers the content text layer: column names and address forms belong to the structure and routing layer. After the change, the keywords in the anchor text library and the matching paths of the static rules may not match the new address. At the end, three things need to be done - check the anchor text distribution range, review the static rules, and check the jump between new and old addresses to prevent broken links left by batch changes. Back up before changing, and keep a fallback ready.

2026-10-13

The content has not changed and the page is still slow, check the max-age and s-maxage of the cache headers first.

When the content is not changed but the page loads slowly, the order of checking the cache control header is to first see which layer the instruction acts on: max-age controls the freshness seconds of the browser's private cache, s-maxage controls the shared cache of CDN and will override max-age, no-store makes any cache not store. This article gives the binary method of transport layer and rendering layer, as well as the checking actions of each layer: browser, shared cache, and origin server.

2026-10-13

After changing the server IP or connecting to CDN, what sequence should be followed to review resolution, certificate, and collection?

After changing the server IP or connecting to CDN, the review sequence is a three-level progression: first confirm DNS resolution (prematurely reduce TTL, check the effective range), then verify the certificate chain (check both sides of the edge and origin, align the origin protocol), and finally converge the collection side - the 301 redirect mapping cannot be interrupted, actively push the core pages to Baidu and Bing, and check the source address in the log.

2026-10-15