> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# hostnameAliases

> Mapping for replacing hostnames.

* **Type**: `Record<string, string>`

Some URLs are accessible from multiple domains—for example,
due to staging and production environments or hosting platforms like Netlify.
Use this parameter to define key-value pairs that replace one hostname with another during crawling.
The key is the hostname to replace, the value is its replacement.

<Check>
  Keys must match hostnames exactly.
  You can't use wildcards.
</Check>

The crawler replaces hostnames when it encounters a matching URL—
whether in sitemaps, page links, canonical tags, or redirects.
For example, with `{ "dev.example.com": "example.com" }`,
`https://dev.example.com/solutions/voice-search` becomes `https://example.com/solutions/voice-search`.
The crawler extracts records from the rewritten URL and continues from there, **not** the original.

The mapping doesn't apply to URLs listed in configuration variables, such as:

* [`startUrls`](/doc/tools/crawler/apis/configuration/start-urls)
* [`siteMaps`](/doc/tools/crawler/apis/configuration/sitemaps)
* [`pathsToMatch`](/doc/tools/crawler/apis/configuration/actions#param-paths-to-match)

The mapping also doesn't apply to the content extracted from a page.
For example, if you extract text that includes the hostname to be replaced,
the original text is extracted.

## Examples

```js JavaScript icon=code theme={"system"}
{
  hostnameAliases: {
    "dev.example.com": "example.com",
  },
}
```
