> For the complete documentation index, see [llms.txt](https://clients.medianova.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/origin-settings/rewrite-origin-urls.md).

# Rewrite Origin URLs

Configure Rewrite Origin URLs to transform request URIs before forwarding requests from the CDN to the origin server.

Rewrite request URIs before the CDN forwards requests to the origin server.

**Rewrite Origin URLs** allows you to replace an incoming request URI with a different target URI. Rewrite rules can apply to all requests or to requests matching a specific path pattern.

You can manage Rewrite Origin URLs in the [Medianova Control Panel](https://cloud.medianova.com) or via the [Origin Settings API](https://clients.medianova.com/api-documentation/performance-cdn/origin-settings#put-api-v1-cdn-organization_uuid-resource-resource_uuid-2).

{% hint style="info" %}
**Origin Settings** is available for CDN Resources that use **My origin** as the content source. The section is not displayed when **Object storage** is selected.
{% endhint %}

## Configure a Rewrite Rule

Create a rewrite rule to define how matching request URIs are transformed before requests are sent to the origin.

{% stepper %}
{% step %}

### Open Origin Settings

Open your CDN Resource and select **Origin Settings**.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2FdoIznHFyQwRdkIPvy2Il%2Fimage.png?alt=media&amp;token=23faf5e2-c483-4f81-a86a-1f27b7260d7b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add a Rewrite Rule

In **Rewrite Origin Urls**, select **Add rewrite rule**.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2FnGaAf7p9dOVq0viegBtA%2Fimage.png?alt=media&amp;token=6dea1f4f-34e4-4543-a40a-552a606320de" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Select the Match Mode

Select how the incoming request is matched:

* **All Files** – Apply the rewrite rule to all requests.
* **Path** – Match requests based on a path.
* **Full Path** – Match requests based on the complete path.
* **Wildcard** – Match requests using a wildcard pattern.
  {% endstep %}

{% step %}

### Configure the Rewrite

Configure the URI values for the rule:

* **Origin URI** – Enter the URI to match.
* **Target URI** – Enter the URI that should replace the matched URI.
  {% endstep %}

{% step %}

### Add the Rewrite Rule

Select **Add rewrite rule** to add the rule to the **Rewrite Origin Urls** list.
{% endstep %}

{% step %}

### Save the Configuration

Select **Save** in the pending changes bar.

Review the pending changes and confirm the update to apply the configuration to the CDN Resource.
{% endstep %}
{% endstepper %}

## Manage Rewrite Rules

Configured rules are displayed in the **Rewrite Origin Urls** table with the following information:

* **Match mode**
* **Original URI**
* **Target URI**
* **Priority**

Use the available actions for a rule to modify or remove it. After making changes, select **Save** in the pending changes bar and confirm the update.

## Match Modes

<table><thead><tr><th width="334.800048828125">Match Mode</th><th>Description</th></tr></thead><tbody><tr><td><strong>All Files</strong></td><td>Applies the rewrite rule to all requests.</td></tr><tr><td><strong>Path</strong></td><td>Matches requests based on a path.</td></tr><tr><td><strong>Full Path</strong></td><td>Matches requests based on the complete path.</td></tr><tr><td><strong>Wildcard</strong></td><td>Matches requests using a wildcard pattern.</td></tr></tbody></table>

## Rewrite Behavior

When a request matches a configured rewrite rule, the CDN rewrites the request URI to the configured **Target URI** before forwarding the request to the origin.

Rewrite Origin URLs changes the URI used for the origin request. It does not change the URL requested by the client.

## Troubleshooting

If a rewrite rule does not produce the expected result:

* Verify that the selected **Match Mode** corresponds to the incoming request URI.
* Verify that **Origin URI** matches the request pattern you intend to rewrite.
* Verify that **Target URI** points to a valid path on the origin.
* If multiple rules could apply, review their order and priority in the **Rewrite Origin Urls** table.

## Related Concepts

* [Advanced Origin Settings](/products/performance-cdn/static-content-delivery/advanced-configuration/origin-settings/advanced-origin-settings.md)
* [Origin SNI Request](/products/performance-cdn/static-content-delivery/advanced-configuration/origin-settings/origin-sni-request.md)
* [Origin Settings API](https://clients.medianova.com/api-documentation/performance-cdn/origin-settings)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/origin-settings/rewrite-origin-urls.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
