Skip to content

Commit 8b09e83

Browse files
sibi361kodster28
andauthored
[Workers] Fix URL Matching Usage in custom_headers.mdx Example (#23541)
* fix: correct noindex example URL pattern typo The previous example for matching `workers.dev` URLs under "Prevent your workers.dev URLs showing in search results" incorrectly used two splats, i.e. `*`, when only one splat can be used at maximum. This commit updates the example to use a single splat wildcard with a placeholder pattern that correctly matches both `workers.dev` URLs and Preview URLs. * fix: update noindex example URL pattern for `pages.dev` * Retrigger CI * Retrigger CI --------- Co-authored-by: Kody Jackson <[email protected]>
1 parent 2e56d27 commit 8b09e83

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/content/partials/workers/custom_headers.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ This applies the `Access-Control-Allow-Origin` header to any incoming URL. To be
117117

118118
[Google](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) and other search engines often support the `X-Robots-Tag` header to instruct its crawlers how your website should be indexed.
119119

120-
For example, to prevent your <code>{props.product === 'workers' ? '\*.workers.dev' : '\*.pages.dev'}</code> URLs from being indexed, add the following to your `_headers` file:
120+
For example, to prevent your {props.product === 'workers' ? <code>\*.\*.workers.dev</code> : <><code>\*.pages.dev</code> and <code>\*.\*.pages.dev</code></>} URLs from being indexed, add the following to your `_headers` file:
121121

122122
<Code
123123
lang="txt"
124124
code={
125125
props.product === "workers"
126-
? `https://*.workers.dev/*\n\tX-Robots-Tag: noindex`
127-
: `https://*.pages.dev/*\n\tX-Robots-Tag: noindex`
126+
? `https://:version.:subdomain.workers.dev/*\n\tX-Robots-Tag: noindex`
127+
: `https://:project.pages.dev/*\n\tX-Robots-Tag: noindex\n\nhttps://:version.:project.pages.dev/*\n\tX-Robots-Tag: noindex`
128128
}
129129
/>
130130

0 commit comments

Comments
 (0)