---
name: "X-Up-Location"
area: "API"
kind: "HTTP header"
parent: "up.protocol module"
url: "https://unpoly.com/api/X-Up-Location"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.protocol module](https://unpoly.com/api/up.protocol.md)</nav>

# X-Up-Location

The server may set this response header to set a custom browser location after a fragment update.

Without an `X-Up-Location` header Unpoly will set the browser location to the [requested URL](https://unpoly.com/api/up.Request.prototype.url.md). After a redirect the URL of the last request is used. You only need to set `X-Up-Location` when you want to explicitly set a different URL.

When setting `X-Up-Location` it is recommended to also set [`X-Up-Method`](https://unpoly.com/api/X-Up-Method.md).

## Example {#example}

```http
X-Up-Location: /current-url
X-Up-Method: GET
```

## Revealing an element {#revealing-an-element}

The URL may contain a `#hash`, e.g. `X-Up-Location: /users#alice`. Unpoly then [reveals](https://unpoly.com/learn/scrolling.md) the element with that ID, like after following a link to `/users#alice`. A `#hash` in this header replaces any `#hash` of the requested URL.

