---
title: Avoiding duplicate-content SEO with vercel.app URLs and custom domains
description: Discover why search engines may treat your vercel.app URL and custom domain as separate pages, and how to consolidate ranking signals and protect your SEO.
url: /kb/guide/avoiding-duplicate-content-with-vercel-app-urls
canonical_url: "https://vercel.com/kb/guide/avoiding-duplicate-content-with-vercel-app-urls"
published: 2025-11-03
last_updated: 2025-11-27
authors: Justin Vitale
related:
  - /docs/deployments/preview-deployments
  - /docs/custom-domains
  - /docs/git
  - /docs/vercel-firewall/vercel-waf/custom-rules
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---
<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [Deploying & Redirecting Domains](https://vercel.com/docs/domains/working-with-domains/deploying-and-redirecting?from=related) — Learn how to deploy your domains and set up domain redirects with this guide.
- [Configuring Domains](https://vercel.com/docs/platforms/multi-tenant-platforms/configuring-domains?from=related) — Add, verify, redirect, and remove wildcard and custom domains for a multi-tenant application using the Vercel SDK.
- [Incremental Migration](https://vercel.com/docs/incremental-migration?from=related) — Learn how to migrate your app or website to Vercel with minimal risk and high impact.
- [Reference](https://vercel.com/docs/platforms/multi-tenant-platforms/reference?from=related) — Reference for the Vercel domain API, error codes, troubleshooting, and FAQ for multi-tenant platforms.
- [Adding a Domain](https://vercel.com/docs/domains/working-with-domains/add-a-domain?from=related) — Learn how to add a custom domain to your Vercel project, verify it, and correctly set the DNS or Nameserver values.
- [Are Vercel Preview Deployments indexed by search engines?](https://vercel.com/kb/guide/are-vercel-preview-deployment-indexed-by-search-engines?from=related) — Vercel Preview Deployments aren't indexed by default. Learn how the noindex header works, how to confirm it, and the cus
- [How do I add a custom domain to my Vercel project?](https://vercel.com/kb/guide/how-do-i-add-a-custom-domain-to-my-vercel-project?from=related) — Learn how to add a custom domain to your Vercel project.
- [Using Vercel as a Standalone CDN](https://vercel.com/kb/guide/using_vercel_as_a_cdn?from=related) — Use Vercel's external rewrites to proxy and cache content from external websites or APIs through Vercel's global edge ne
- [How can I serve multiple projects under a single domain?](https://vercel.com/kb/guide/how-can-i-serve-multiple-projects-under-a-single-domain?from=related) — Learn how to serve multiple Vercel projects from a single domain.
- [Build a multi-tenant app with Next.js and Vercel](https://vercel.com/kb/guide/nextjs-multi-tenant-application?from=related) — Create a Next.js application with multi-tenancy and custom domain support on Vercel.

Full cross-link map for this page: [/kb/guide/avoiding-duplicate-content-with-vercel-app-urls.graph.md](/kb/guide/avoiding-duplicate-content-with-vercel-app-urls.graph.md)
<!-- /docsgraph:related -->


If your Production site is accessible at **both** `your-project.vercel.app` _and_ a custom domain (for example, `https://your-custom-domain.com`), search engines can treat those URLs as separate pages which can potentially affect your SEO performance.

Vercel [Preview deployments](https://vercel.com/docs/deployments/preview-deployments) are **not indexed by search engines** by default because the `**X-Robots-Tag**` HTTP header is set to `noindex` automatically by Vercel. However, if you're using a [custom domain](https://vercel.com/docs/custom-domains) that is assigned to a [non-Production branch](https://vercel.com/docs/git#production-branch), the header `X-Robots-Tag: noindex` will **not** be set.

This guide walks you through the three-step process Vercel recommends to ensure crawlers recognize **one** canonical version of each page, while still letting you (and your users) preview deployments on the `vercel.app` host.

### 1\. Declare a canonical URL in every page

Add a `<link rel="canonical" …>` tag in the `<head>` of every HTML page so that crawlers know which host (and scheme) is authoritative:

`<link rel="canonical" href="https://your-custom-domain.com/{{ pathname }}" />`

- Use the absolute HTTPS URL including any trailing slash or path segments.
  
- In frameworks like **Next.js** or **SvelteKit**, place this in your shared document/layout component so it’s injected automatically.
  

### 2\. Use the 'X-Robots-Tag' header to prevent the vercel.app host from being indexed

The `X-Robots-Tag: noindex` header tells search engines and crawlers to drop the page from their indexing entirely. This can be configured using `vercel.json` or using framework-level configurations (e.g. `next.config.js`) (preferred).

### 2.1 Default to a framework-level header

If your framework supports `headers()` (Next.js) or a similar API, use this by default as framework headers are merged **after** `vercel.json`:

```javascript
// next.config.js
module.exports = {
  headers: async () => [
    {
      source: '/:path*',
      has: [{ type: 'host', value: 'your-project.vercel.app' }],
      headers: [{ key: 'X-Robots-Tag', value: 'noindex' }]
    }
  ]
};
```

### 2.2 Fallback to vercel.json

If your framework doesn't support implementing headers, or you prefer a simpler approach, you can set the tag in your `vercel.json` configuration instead:

```javascript
{
  "headers": [
    {
      "source": "/(.*)",
      "has": [{ "type": "host", "value": "your-project.vercel.app" }],
      "headers": [{ "key": "X-Robots-Tag", "value": "noindex" }]
    }
  ]
}
```

### 3\. Redirect traffic from unwanted hostnames

Even with the `X-Robots-Tag: noindex` header enabled, users could still visit your `vercel.app` URL directly. To handle this, create a **WAF Custom Rule** that issues an HTTP **Redirect** to the canonical domain:

1. Go to **Project → Firewall** in the Vercel Dashboard.
   
2. Click **Add Rule** → name it “Redirect to canonical”.
   
3. Configure the condition and action as above.
   
4. Click **Save Rule** – changes propagate globally without requiring a new deployment.
   

Learn more about WAF Custom Rule configurations: [https://vercel.com/docs/vercel-firewall/vercel-waf/custom-rules](https://vercel.com/docs/vercel-firewall/vercel-waf/custom-rules)

### 4\. Putting it all together

Verify your changes:

**1\.** Perform a `curl` lookup for your project's `vercel.app` URL and confirm the response header:

`curl -I https://your-project.vercel.app`

`X-Robots-Tag: noindex` should be surfaced in the response.

- **X-Robots-Tag: noindex** → prevents `.vercel.app` pages from entering the index.
  

**2\.** Inspect the HTML source of your custom domain and confirm the canonical tag points to the same host.

- **Canonical tag** → tells search engines which URL to rank.
  

**3\.** Manually navigate to your project's `vercel.app` URL in a browser to verify your WAF redirect works as intended.

- **WAF Redirect** → ensures humans (and link equity) end up on the canonical host.
  

**4\.** Use Google Search Console’s **URL Inspection** tool to check your domain's indexing status: [https://support.google.com/webmasters/answer/9012289?hl=en](https://support.google.com/webmasters/answer/9012289?hl=en)

With these four layers in place, you’ll avoid duplicate-content penalties while retaining all the convenience of Vercel Preview Deployments and multiple domains.