# URL Rewriting

The reverse proxy can rewrite URLs through redirects. Use this when a proxied application returns links that must point to a different path or host.

Configure URL rewriting on a specific URI pattern in the content provider. The pattern identifies the request that should trigger the redirect.

{% stepper %}
{% step %}

### Open the content provider

Sign in to **Webconsole** and go to **Access Control** → **Content Providers**.

![](/files/92511c531fd2066c3159704286cc3ee39a08aca8)

Open the content provider you want to update.
{% endstep %}

{% step %}

### Configure the URI pattern

Create a new **URI Pattern**.

<figure><img src="/files/0a3574d8b3a83eecf06335a2d297dcb9ef102688" alt=""><figcaption></figcaption></figure>

Or edit an existing one.

<figure><img src="/files/d4aef112b94fd9ecb7d12e8663f094675c27e25e" alt=""><figcaption></figcaption></figure>

If you create a new pattern, configure it and add it to the list.

<figure><img src="/files/bc808014017e913a1078abebd2a6fc27322e1e54" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add redirect metadata

On the **URI Pattern** screen, scroll to `Meta Data` and click the `plus` icon.

<figure><img src="/files/48f747c8deb160ba370617e2bb00fff6343ca108" alt=""><figcaption></figcaption></figure>

In the dialog, add either `Redirect URL` or `Redirect URL Groovy Script`.

`Redirect URL` is a static absolute or relative URL. The proxy redirects requests that match this URI pattern to that value.

<figure><img src="/files/e2410b6dc25c8d38f80bd2717240a5647669841f" alt=""><figcaption></figcaption></figure>

`Redirect URL Groovy Script` takes precedence over `Redirect URL`. Use it when the redirect target must be computed at runtime. The Groovy script must return the target URL.

<figure><img src="/files/44aa3b10704d9d9cd9d8efa80b3e1ab124f9daef" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

There is another redirect option that is used mostly internally, but you can use it when needed.

`rProxy` can check for a special header named `OIAM_EULA_TEST_CH`. If the header is set, `rProxy` redirects to the value stored in that header. To configure that header, see [Adding headers in request and/or response](/sso-to-legacy-applications/adding-headers-in-request-and-or-response.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-beta.openiam.com/sso-to-legacy-applications/url-rewriting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
