| 1 | --- |
| 2 | title: "HX-Replace-Url" |
| 3 | description: "Replace the current URL in the browser history" |
| 4 | --- |
| 5 | |
| 6 | The `HX-Replace-Url` response header replaces the current URL in the browser location history. This does not create a new history entry — it removes the previous current URL from the browser's history. |
| 7 | |
| 8 | If present, this header overrides any behavior defined with attributes. |
| 9 | |
| 10 | ## Possible Values |
| 11 | |
| 12 | - A URL to replace the current URL in the location bar. May be relative or absolute, as per [`history.replaceState()`](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState), but must have the same origin as the current URL. |
| 13 | - `false` — prevents the browser's current URL from being updated. |
| 14 | |
| 15 | ## Example |
| 16 | |
| 17 | ```http |
| 18 | HX-Replace-Url: /dashboard |
| 19 | ``` |
| 20 | |
| 21 | ## Notes |
| 22 | |
| 23 | - Response headers are not processed on 3xx response codes. |
| 24 | |
| 25 | See also: [`hx-replace-url`](/reference/attributes/hx-replace-url), [`HX-Push-Url`](/reference/headers/HX-Push-Url) |