Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/content/partials/workers/custom_headers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ This applies the `Access-Control-Allow-Origin` header to any incoming URL. To be

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

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:
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:

<Code
lang="txt"
code={
props.product === "workers"
? `https://*.workers.dev/*\n\tX-Robots-Tag: noindex`
: `https://*.pages.dev/*\n\tX-Robots-Tag: noindex`
? `https://:version.:subdomain.workers.dev/*\n\tX-Robots-Tag: noindex`
: `https://:project.pages.dev/*\n\tX-Robots-Tag: noindex\n\nhttps://:version.:project.pages.dev/*\n\tX-Robots-Tag: noindex`
}
/>

Expand Down