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

# Domain Redirect Auditor

> Checks that a domain redirects to the goal domain you set, such as nuplia.com to www.nuplia.com.br

> [!NOTE]
>
> **Resilience Auditor**: follows the redirects of a domain you own and checks that they end on the site you chose.

> [card] Traffic
>
> Makes sure visitors and links on your other domains reach your main site.

> [card] Search
>
> Confirms the redirect uses the code you chose, so search rankings move to the right address.

Companies often own several domains for one site: country domains, old brands, common misspellings. Each one should send visitors to the main site. A redirect that is removed in a DNS or hosting change, or left pointing at an old site, goes unnoticed because nobody visits those domains on purpose. This auditor follows the redirects of the monitored URL and compares where they end with the goal domain you set.

## Preferences

| Key | Type | Default | Description |
| - | - | - | - |
| `goalDomain` | string | none, required | Where this URL should end up: scheme and host only, such as `https://www.nuplia.com.br`, `http://nuplia.co.jp` or `https://nuplia.com.ar`. A port is allowed; a path or query is not (`502`). The audit does not run until it is set. |
| `expectedRedirectCode` | integer | none | The code of the redirect that arrives on the goal domain: `301`, `302`, `303`, `307` or `308`. Blank accepts any permanent redirect (`301` or `308`). |

## How it works

1. **Preferences**: an invalid goal (`502`), an invalid expected code (`504`) or a goal on the same address as the monitored URL (`503`) ends the audit before any request.
2. **Follow**: sends a `GET` request as 37AuditsBot and follows each `Location` by hand, up to 10 hops. Only HTTP redirects count: meta refresh and JavaScript redirects are not followed.
3. **Blocks**: a block on any address before the goal ends the audit with `590`. An HTTP 403 or 429 on the goal itself does not, because the redirect has already arrived.
4. **Compare**: the scheme, host and port where the redirects end must match the goal exactly. `www.nuplia.com.br` and `nuplia.com.br` are different hosts. The landing path is ignored, so `https://www.nuplia.com.br/en` matches the goal `https://www.nuplia.com.br`.
5. **Arrival hop**: the redirect code is judged on one hop only, the first one whose target is on the goal. Hops before it are the source domain's own housekeeping (http to https, apex to www; see the [HTTP Redirect auditor](https://docs.37audits.com/auditors/http-redirect-auditor.md)). Hops after it are the goal site's own routing, such as `/` to `/en`.
6. **Aggregate**: `ERROR` wins, then `FAIL`, then `WARNING`. When every rule passes the audit is `SUCCESS` (`200`).

For `nuplia.com` with the goal `https://www.nuplia.com.br`:

```
https://nuplia.com/      301 → https://www.nuplia.com/          source housekeeping, not judged
https://www.nuplia.com/  302 → https://www.nuplia.com.br/en     arrival hop, judged
```

With `expectedRedirectCode` blank this warns (`300`), because the arrival hop is temporary. With `expectedRedirectCode` set to `302` it passes.

## What it audits

Every row maps to one `checkRule*` method and one `CheckCode`, in the order the auditor runs them. CheckCode suffixes use status ranges: `200` success, `300–399` warning, `400–499` fail, `500–599` error.

| CheckCode | Status | When it fires | Recommendation | Why it matters |
| - | - | - | - | - |
| `37A-DomainRedirectAuditor-502` | `ERROR` | The Goal domain is not an `http://` or `https://` address with only a scheme and a host. | Change Goal domain from "`{value}`" to a scheme and host only, such as [https://www.example.com](https://www.example.com). | — |
| `37A-DomainRedirectAuditor-504` | `ERROR` | The Expected redirect code is not `301`, `302`, `303`, `307` or `308`. | Change Expected redirect code from `{value}` to 301, 302, 303, 307 or 308, or leave it blank to accept any permanent redirect. | — |
| `37A-DomainRedirectAuditor-503` | `ERROR` | The Goal domain is on the same scheme, host and port as the monitored URL. | Change Goal domain from `{goal}` to the site `{url}` should redirect to. | — |
| `37A-DomainRedirectAuditor-501` | `ERROR` | A host of the monitored URL or of a redirect does not resolve in DNS. | Add an A or AAAA record for `{host}`, or stop monitoring this URL if the domain is retired. | — |
| `37A-DomainRedirectAuditor-500` | `ERROR` | An address could not be read: timeout, connection failure, or HTTP 5xx before the goal. | Make sure `{failedUrl}` answers within 10 seconds, then run the audit again. Last error: `{error}`. | — |
| `37A-DomainRedirectAuditor-400` | `FAIL` | The monitored URL answers with something other than a redirect. | Make `{url}` answer with a 301 redirect to `{goal}`. | Visitors and links that use this domain stay on it, so traffic and search rankings never reach your main site. |
| `37A-DomainRedirectAuditor-403` | `FAIL` | A hop answers with a redirect status but no `Location` that an HTTP client can follow. | Add "Location: `{goal}`" to the HTTP `{status}` response of `{hopUrl}`. | A redirect without a destination leaves browsers on an error page, so visitors never reach your site. |
| `37A-DomainRedirectAuditor-404` | `FAIL` | The redirects come back to an address already visited, or go past 10 hops. | Remove the loop at `{lastUrl}` so `{url}` reaches `{goal}` in one 301 redirect. | Browsers give up with a "too many redirects" error, so visitors of this domain see no site at all. |
| `37A-DomainRedirectAuditor-401` | `FAIL` | The redirects end on a host that is not the host of the goal. | Change the redirect of `{lastHopUrl}` from `{landingUrl}` to `{goal}`, or update the Goal domain preference if `{landingHost}` is the new destination. | Visitors and links end up on a site you did not choose, which loses the traffic and can hand it to an old or third-party site. |
| `37A-DomainRedirectAuditor-402` | `FAIL` | The redirects end on the host of the goal, but with another scheme. | Make the redirect of `{lastHopUrl}` point to `{goal}` instead of `{landingUrl}`. | Visitors reach the right site on an address you did not choose, which splits search rankings and can leave them on an unencrypted connection. |
| `37A-DomainRedirectAuditor-405` | `FAIL` | The redirects end on the goal, on a page that answers HTTP 404, HTTP 410 or HTTP 5xx. | Fix `{landingUrl}` on `{goalHost}`, or point the redirect at a page that exists. | The redirect works, but it delivers visitors to an error page, so they leave and the traffic is lost. |
| `37A-DomainRedirectAuditor-300` | `WARNING` | The arrival hop does not use the Expected redirect code, or is not permanent when that preference is blank. | Change the redirect of `{hopUrl}` to `{target}` from HTTP `{status}` to `{expected}`, or update the Expected redirect code preference if HTTP `{status}` is intended. | The redirect does not behave as you chose: a temporary one keeps search rankings on the old domain, and a permanent one is remembered by browsers and is hard to undo. |
| `37A-DomainRedirectAuditor-200` | `SUCCESS` | All rules passed. Message is `{url} reaches {landingUrl} in {hopCount} hops, arriving on the goal {goal} with HTTP {status}.` | — | — |
| `37A-DomainRedirectAuditor-590` | `ERROR` | The audited page answered HTTP 403, HTTP 429 or a Cloudflare challenge, so 37AuditsBot was blocked before it could read the page. | Allow 37AuditsBot in your firewall or bot protection: allowlist its user agent, or verify its Web Bot Auth signature. See [https://www.37audits.com/bot](https://www.37audits.com/bot). | While 37AuditsBot is blocked this audit cannot look at the site, so problems on it go unreported. |

## Output documentation

| Status | Description | Test logic |
| - | - | - |
| **SUCCESS** | The URL reaches the goal with the expected redirect | Scheme, host and port match the goal, and the arrival hop uses the expected code (`200`). |
| **WARNING** | The goal is reached with another redirect code | Arrival hop differs from the Expected redirect code, or is temporary when that is blank (`300`). |
| **FAIL** | Visitors do not reach the goal, or reach a broken page | No redirect (`400`); wrong host (`401`); wrong scheme (`402`); no usable `Location` (`403`); loop or more than 10 hops (`404`); error page on the goal (`405`). |
| **ERROR** | The auditor could not test the redirect | Connection failure or HTTP 5xx before the goal (`500`); host does not resolve (`501`); invalid preference (`502`, `504`); goal is the monitored URL (`503`); site blocked 37AuditsBot (`590`). |

## Risks and considerations

### Why secondary domains break silently

* Nobody on your team visits these domains, so a redirect lost in a hosting, DNS or CDN change can stay broken for months while old links and ads keep sending people there.
* Registering a domain and forgetting its redirect leaves traffic on a parked page, or on an old site you no longer maintain.

### Choosing the redirect code

* Use `301` or `308` when the move is final: search engines transfer rankings to the goal and browsers remember the redirect.
* Use `302` or `307` when the destination may change, for example while a country site is being launched. Set Expected redirect code so the audit does not warn about it.
* Browsers can remember a permanent redirect for a long time, so changing its destination later does not reach every returning visitor.

### What this auditor does not check

* Only the monitored URL is followed. Add each variant you care about (`http://`, `www.`) as its own monitored URL.
* A temporary redirect before the arrival hop is not reported.
* Meta refresh and JavaScript redirects count as no redirect (`400`). Search engines handle them less reliably than HTTP redirects.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.