Validate the raw Location value before following it, resolve relative references against the exact source URL, and compare the resulting scheme, host, path, query, redirect chain, final response, and canonical signals with the approved redirect map.
- The Location field contains a URI reference, so a redirect target can be absolute or relative.
- Relative targets resolve against the exact source URL, which makes path depth and trailing-slash behavior operationally important.
- Old query parameters are not something a team should assume will survive; test the resolved target explicitly.
- A redirect passes only when the raw response, resolved target, complete chain, final page, and site-wide URL signals all agree.
01
Definition
The HTTP Location response field identifies a URI reference associated with a response. In a redirect response, that reference tells the client where it can automatically make the next request. The value does not have to be a complete absolute URL; the HTTP standard permits a URI reference, which can be absolute or relative. [1]
That flexibility is useful, but it creates a validation requirement. A raw value such as /new-page, next, or ../replacement is not the final target by itself. The client resolves it against the exact source URL. A redirect rule can therefore produce different destinations at different path depths even when its Location text looks identical.
For migration work, the meaningful object is the resolved target URL, not merely the string printed in the Location header. Teams should preserve both in their evidence: the raw response value and the absolute URL produced after standards-based resolution.
02
Mechanism
URI reference resolution follows a defined process. The source request URL acts as the base. An absolute Location value supplies its own scheme and authority. A reference beginning with a slash replaces the path from the origin root. A path-relative value is merged with the base path. Dot segments such as . and .. are removed during normalization. Query handling depends on the reference rather than on an assumption that the original query will be copied. [2]
Consider a source request to https://example.com/catalog/old/page?item=7.
- A Location value of
https://example.com/new/pageis already absolute. - A Location value of
/new/pageresolves from the origin root tohttps://example.com/new/page. - A Location value of
nextresolves relative to the source path directory, producinghttps://example.com/catalog/old/next. - A Location value of
../newresolves tohttps://example.com/catalog/newafter dot-segment processing.
These outcomes are deterministic, but they are easy to misread during a configuration review. A rule that appears to send traffic to next may work at one path and fail at another because the base directory changed.
The redirect status code supplies separate semantics. A 301 or 308 indicates a permanent move; a 302 or 307 indicates a temporary one in Google Search documentation. The Location value supplies the target. Both pieces must be correct. A permanent status does not rescue a malformed target, and a perfect target does not correct the wrong permanence. [3]
03
Examples
A host migration often uses an absolute target because the destination authority changes. For example, a source on old.example.com can redirect to https://www.example.com/new-path. Validation should compare scheme, hostname, port, path, query, and final response against the redirect map.
A same-host content move may use an origin-relative target such as /guides/new-name. This can be concise and valid. It should still be tested behind the actual reverse proxy, CDN, application framework, and production host rules because those layers may rewrite schemes, hosts, or path prefixes.
A path-relative target can be safe when it is deliberately scoped to one directory. It becomes risky when a broad pattern applies at several path depths. A rule returning replacement from both /a/old and /a/b/old resolves to two different destinations. A sample test at only one depth will miss the error.
Query handling creates another common failure. Suppose an old product URL uses ?sku=123. A Location value of /products/new should not be assumed to retain sku=123. If the parameter is required at the destination, the redirect implementation must construct and test the intended query. If it is obsolete tracking noise, dropping it may be correct. The decision belongs in the redirect specification rather than in folklore about what servers usually do.
Encoding also deserves explicit fixtures. Test spaces, non-ASCII characters, percent-encoded slashes, reserved characters, uppercase and lowercase paths on case-sensitive systems, and URLs with or without trailing slashes. The goal is not to invent exotic edge cases for sport. It is to cover the shapes already present in logs, sitemaps, backlinks, and internal databases.
04
Validation sequence
Capture the first response without automatic redirect following. Record the source URL, status code, raw Location value, cache headers, and timestamp. Resolve the Location value with a standards-compliant URL library using the exact source as the base.
Then run the following checks:
- Compare the resolved scheme, host, port, path, query, and fragment behavior with the approved mapping.
- Follow the redirect and record every hop rather than only the final page.
- Reject loops, returns to an earlier URL, and chains that add avoidable intermediate redirects.
- Confirm that the final response is successful, relevant, indexable when intended, and not a soft error.
- Test representative URLs at every path depth and pattern covered by the rule.
- Test query-bearing URLs, encoded characters, case variants, and trailing-slash variants found in real data.
- Test non-GET methods when forms, APIs, callbacks, or application routes can reach the source.
- Compare internal links, canonical tags, sitemap entries, hreflang references, feeds, and structured data with the final destination.
Google recommends mapping old URLs to their new destinations and using permanent server-side redirects for permanent site moves. It also recommends avoiding irrelevant mass redirects to a homepage. A validation report should therefore test target relevance as well as transport mechanics. [3]
Run the redirect map through automated tests before deployment and again against the deployed environment. Save the raw responses and resolved targets as machine-readable evidence. After launch, use server logs and crawl data to identify source URLs that missed the map, unexpected chains, loops, and final responses that changed after approval.
05
Boundaries
A relative Location value is not automatically an error. It is allowed by the standards and can be appropriate. The operational question is whether it resolves to the intended target for every source URL covered by the rule.
Conversely, an absolute URL is not automatically safe. It can hard-code the wrong scheme, hostname, environment, language host, tenant, or deployment domain. Absolute and relative forms each need context-aware tests.
Redirect validation cannot prove search consolidation by itself. Search systems also evaluate the destination, canonical signals, crawl access, internal linking, sitemaps, and time. The HTTP response is necessary evidence, not the whole verdict.
The release threshold should be concrete: the raw Location value is permitted, the resolved target matches the approved map, every tested source reaches one relevant final URL without a loop, method behavior is correct, and the rest of the site points directly to the preferred destination. Anything less is a redirect that happens to return a 3xx response, which is a much lower achievement.
References
Sources behind this record
- HTTP Semantics, Plain Text Edition — RFC Editor (accessed August 18, 2026)
- Uniform Resource Identifier (URI): Generic Syntax — RFC Editor (accessed August 18, 2026)
- Site Moves with URL Changes — Google Search Central (accessed August 18, 2026)
Corrections
Correction history
No corrections recorded.
To report an error, use the public corrections path.
This guide covers HTTP target resolution and migration validation, not every browser, proxy, CDN, framework, or crawler implementation detail.
A syntactically valid Location value can still be editorially wrong, unsafe, irrelevant, non-indexable, or inconsistent with the intended canonical URL.