---
title: LocationHeaderFilter
description: For a response that generates a redirect to the proxied application, this filter rewrites the Location header on the response to redirect the user to PingGateway.
component: pinggateway
version: 2026
page_id: pinggateway:reference:LocationHeaderFilter
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/LocationHeaderFilter.html
revdate: 2025-04-28T10:25:51Z
section_ids:
  LocationHeaderFilter-usage: Usage
  LocationHeaderFilter-properties: Properties
  LocationHeaderFilter-example: Example
---

# LocationHeaderFilter

For a response that generates a redirect to the proxied application, this filter rewrites the Location header on the response to redirect the user to PingGateway.

## Usage

```none
{
    "name": string,
    "type": "LocationHeaderFilter",
    "config": {
        "baseURI": runtime expression<url>
    }
}
```

## Properties

* `"baseURI"`: *runtime expression<[url](preface.html#definition-url)>,optional*

  The base URI of the PingGateway instance. This is used to rewrite the Location header on the response.

  The result of the expression must be a string that represents a valid URI, but isn't a real `java.net.URI` object. For example, it would be incorrect to use `${request.uri}`, which isn't a String but a MutableUri.

  Default: Redirect to the original URI specified in the request.

  Learn more in [PingGateway expressions](Expressions.html).

## Example

In the following example, PingGateway listens on `https://ig.example.com:8443` and the application it protects listens on `https://app.example.com:8444`. The filter rewrites redirects that would normally take the user to locations under `https://app.example.com:8444` to go instead to locations under `https://ig.example.com:8443`.

```json
{
     "name": "LocationRewriter",
     "type": "LocationHeaderFilter",
     "config": {
         "baseURI": "https://ig.example.com:8443"
      }
}
```
