---
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 IG.
component: pinggateway
version: 2023.11
page_id: pinggateway:reference:LocationHeaderFilter
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/LocationHeaderFilter.html
llms_txt: https://docs.pingidentity.com/pinggateway/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: 2025-06-03T11:21:31Z
superseded_by: https://docs.pingidentity.com/pinggateway/2026/reference/LocationHeaderFilter.html
section_ids:
  LocationHeaderFilter-usage: Usage
  LocationHeaderFilter-properties: Properties
  LocationHeaderFilter-example: Example
  LocationHeaderFilter-moreinfo: More information
---

# 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 IG.

## Usage

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

An alternative value for type is RedirectFilter.

## Properties

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

  The base URI of the IG 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 is not a real `java.net.URI` object. For example, it would be incorrect to use `${request.uri}`, which is not a String but a MutableUri.

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

  See also [Expressions](Expressions.html#Expressions).

## Example

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

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

## More information

[org.forgerock.openig.filter.LocationHeaderFilter](../_attachments/apidocs/org/forgerock/openig/filter/LocationHeaderFilter.html)
