# Rewrite Origin URLs

**Rewrite Origin URLs** enables you to transform incoming paths before they are forwarded to origin servers. You can configure **Match Mode**, **Origin URI**, **Target URI**, and **Priority** to adjust how paths are rewritten for directory changes, API restructuring, or backend routing needs.

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

In the Medianova Control Panel, go to **CDN Resources**, select your resource, and navigate to **Origin Settings**

## Manage Rewrite Origin URLs

Follow the steps below to add and manage Rewrite Origin URLs for your CDN Resource.

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

{% stepper %}
{% step %}
**Add a Rewrite Origin URL**

Select **Add** to create a new Rewrite Origin URL.

<figure><img src="/files/Onga01G2gJkOC0o6SY4h" alt="" width="563"><figcaption></figcaption></figure>

The Add Rewrite Origin URL popup appears.
{% endstep %}

{% step %}
**Configure Parameters**

Fill in the required fields in the popup:

* **Match Mode** — Choose how the incoming path is matched.\
  Options include:
  * `All files`
  * `Path`
  * `Full Path`
  * `Wildcard`
* **Origin URI** — Enter the incoming request path to match.
* **Target URI** — Enter the new path that requests will be rewritten to.
* **Priority** — Lower values are evaluated first when multiple Rewrite Origin URLs exist.
  {% endstep %}

{% step %}
**Save the Configuration**

Select **Add**, then click **Submit**.\
Your Rewrite Origin URL is added to the list.
{% endstep %}
{% endstepper %}

### **Match Mode Behavior**

* **All files**: Applies to every incoming request.
* **Path**: Matches only the path portion of the request URI.
* **Full Path**: Matches the exact full URL path.
* **Wildcard**: Enables dynamic pattern matching using wildcard symbols.

## **Troubleshooting**

**Issue:** Rewrite Origin URL does not apply.\
**Cause:** Incorrect Match Mode or Origin URI format.\
**Fix:** Verify that the incoming request path matches the defined parameters.

**Issue:** A different Rewrite Origin URL is applied first.\
**Cause:** Priority ordering conflict.\
**Fix:** Assign a lower priority value to the entry you want processed first.

**Issue:** Origin returns 404 after rewrite.\
**Cause:** Target URI does not exist on the origin.\
**Fix:** Confirm that the target path is valid and reachable at the origin server.


---

# 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://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/origin-settings/rewrite-origin-urls.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.
