# Configuring URL redirects

Source: https://docs.arcxp.com/en/products/delivery/configuring-url-redirects.html

Use the Redirects page in Delivery to create and manage redirect rules for your sites. The Redirects page lets you create both 301 (permanent) and 302 (temporary) redirects directly in the application and requires minimal technical knowledge. You can use both full URLs and regular expressions to define your rules.

The Redirects page lets you create a maximum of 1000 redirect rules per site.

> **Note:**
> 
> You can also implement redirects programmatically using Draft API and resolvers. This method requires an understanding of how to interact with Draft API and how to set up resolvers.
> 
> Implementing redirects programmatically allows you to create and manage redirects and prevents the Redirects page from becoming cluttered; therefore, we recommend using Draft API when setting up redirects for stories. See [How To Create Story Document URL Redirects Using Draft API](https://docs.arcxp.com/en/products/publishing-platform/how-to-create-story-document-url-redirects-using-draft-api.html) and [Configuring resolvers](https://docs.arcxp.com/en/products/pagebuilder/pagebuilder-editor/developer-tools-overview/configuring-resolvers.html).

## Redirect scenarios

The following table describes various scenarios when you may need to configure a redirect and the tool that Arc XP recommends using.

| Scenario                                                                                                                                           | Redirect tool                                                         |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| Add or modify existing ReGex- and wildcard-based redirects (path-based)For example,^/example.com/page?$tohttps://example.com/page2/?               | Redirects page                                                        |
| Add or modify existing query parameter-based redirectsFor example,example.com/\*?outputType=amptom.example.com/\*                                  | Redirects page                                                        |
| Add or modify existing domain name-based redirectsFor example,m.example.com/\*towww.example.com./\*                                                | Redirects page                                                        |
| Add or modify existing protocol-based redirectsFor example,http.example.com/\*tohttps.example.com./\*                                              | Redirects page                                                        |
| Story-based and vanity URL redirect requests, both single and multi-siteFor example,http.example.com/sports1.htmltohttps.example.com./sports2.html | Draft API                                                             |
| Geo-based redirects or geolocation-based redirectsFor example, renaming an article likeexample.eu/politics/story1toexample.com/politics/story2     | Contact[Arc XP Customer Support](https://support.arcpublishing.com/). |
| User agent-based redirects                                                                                                                         | Contact[Arc XP Customer Support](https://support.arcpublishing.com/). |
| Cookie-based redirects                                                                                                                             | Contact[Arc XP Customer Support](https://support.arcpublishing.com/). |
| Redirect to an alternate originFor example, redirectsandbox.<customer>.comtoorigin.sandbox.<customer>.com                                          | Contact[Arc XP Customer Support](https://support.arcpublishing.com/). |

## Prerequisites

To use the Redirects page, you must:

- have the appropriate permissions for redirects, granted for all sites:

  - Viewer - can view and download rules
  - Content Editor - can add, edit, and delete rules, view the activated version, and download rules
  - Content Publisher - can add, edit, and delete rules, activate version, and download rules  
> **Note:**  
>  
> Redirect permissions apply to all of your sites. A user who manages redirects must be in a group or squad that has the permission for all sites. Users in groups restricted to a single site cannot open the Redirects page, so you cannot limit a user to creating redirects for only one of your sites.
- be familiar with redirect types. See [What are the different kinds of redirects in Arc XP?](https://docs.arcxp.com/en/products/publishing-platform/what-are-the-different-kinds-of-redirects-in-arc-xp-.html)

## Scenario: Managing URL changes with the Redirects page

Your team decides to update your site’s structure, moving all news content from `/news` to `/updates`. To ensure visitors using old links still land on the correct pages, you use the Redirects page in Delivery to create the following regex redirect rule:

- `^/news/(.*)` redirects to `/updates/\1`

After adding the rule, you activate your updated ruleset to ensure the latest changes take effect.

## Procedures

## Creating or editing redirect rules

You can manually create or edit redirect rules.

> **Note:**
> 
> The Redirects page lets you create a maximum of 1000 redirect rules per site.

1. Navigate to the **Delivery** application.
2. Click **URLs > Redirects**. The Redirects page opens.
3. Select a website to add redirect rules to.
4. Click **Add Rule**. The Add Rule pane opens.  
To edit an existing rule, click ![icon_ellipsis.png](https://docs.arcxp.com/images/learning-center/image/img-36e988534106c557aab2119deabbbed2.png) **\> Edit**.
5. Complete the following fields:

**If source matches**

  - **Match type** \- select the type of redirect you want to create, either URL Path or URL Regular Expression.
  - **URL Path** \- if you chose URL Path in the Match type field, enter the URL you want to redirect from.
  - **Regular expression** \- if you chose URL Regular Expression in the Match type field, enter the regular expression to define the redirect source.

**Then redirect to**

  - **Redirect URL** \- enter the URL you want to redirect to.
  - **Absolute URL** \- choose this option if you’re redirecting from one domain to another. This option appears only if you chose URL Path as the Match type.
  - **Relative Path** \- choose this option if you’re directing within the same domain. This option appears only if you chose URL Path as the Match type.
  - **Type** \- choose the type or redirect you’re creating: Permanent 301 or Temporary 302.  
  301 (permanent) is best if the URL is a permanent change. Search engines transfer ranking power from the old URL to the new one.  
  302 (temporary) is best for short-term changes or testing. Search engines typically keep the original URL indexed and may not transfer SEO value to the new URL.
  - **Copy query string** \- select this option to copy the query string from the original URL to the redirect path.  
  For example, suppose you create the following rule:

    - Original URL: `/news?category=world&country=argentina`
    - Redirect rule: `/news` redirects to `/updates`  
  With query string copying enabled:

    - Original URL: `/news?category=world&country=argentina`Original URL:
    - Resulting URL: `/updates?category=world&country=argentina`  
  With query string copying disabled:

    - Original URL: `/news?category=world&country=argentina`
    - Resulting URL: `/updates`
  - **If set, negates the match** \- select this option to negate the match. This means that the redirect applies when the URL does not match the rule.  
  For example, suppose you create the following rule:

    - URL Path/RegEx: `/example/(.*)`
    - Redirect URL: `/news/`  
  Without negation:

    - `/example/article-1` redirects to `/news/`
    - `/example/article-2` redirects to `/news/`
    - `/about` does not redirect  
  With negation enabled:

    - `/example/article-1` does not redirect
    - `/example/article-2` does not redirect
    - `/about` redirects to `/news/`
  - **Case sensitive rule** \- select this option for the URL path or RegEx condition to match only URLs that exactly match the specified capitalization.
6. Click **Add**. The system adds the redirect rule to your list of rules.

Your redirect rules are not live until you activate them. See ???.

## Uploading redirect rules

You can upload a CSV file of redirect rules. This is particularly helpful if you have many rules.

> **Note:**
> 
> The Redirects page lets you create a maximum of 1000 redirect rules per site.

1. Navigate to the **Delivery** application.
2. Click **URLs > Redirects**. The Redirects page opens.
3. Select a website to add redirect rules to.
4. Click **Upload Rules**. The Upload rules via CSV pane opens.
5. Click **Download sample .csv** to download a template. Update the template to include your redirect rules.  
NoteTo make a path case sensitive in the CSV file, add a colon (:) at the beginning of the path field. For example:id,path,regex,redirectURL,useRelativeUrl,useIncomingQueryString,statusCode,submittedBy,submittedAt,errors 8b2130f9-bbcb-42ee-9284-b76b74194fe9,:/caseSensitivePath,,/path1/path2/path3,relative\_url,False,301,[jsmith@example.com](mailto:jsmith@example.com),1657157074,
6. Click **Select File** and choose your CSV file.
7. Choose one of the following options:

  - **Replace all rules** \- choose this option to replace all existing rules with the rules in your CSV file.
  - **Append to existing** \- choose this option to add your CSV file to the existing rules.
8. Click **Upload rules**. The system imports your rules.

Your redirect rules are not live until you activate them. See ???.

## Deleting redirect rules

You can delete redirect rules that you no longer need.

1. Navigate to the **Delivery** application.
2. Click **URLs > Redirects**. The Redirects page opens.
3. Select a website to delete rules from.
4. Click ![icon_ellipsis.png](https://docs.arcxp.com/images/learning-center/image/img-36e988534106c557aab2119deabbbed2.png) **\> Delete** on the rule you want to delete.

Your deleted rules do not become inactive until you reactivate the ruleset. See ´???.

## Activating a redirect version

After you add, modify, or delete your rules, you must activate the ruleset for the redirects to take effect on your site.

When you activate your ruleset, the system locks the screen for editing or creating new rules.

> **Note:**
> 
> Activating a redirect version can take up to 20 minutes.

1. Navigate to the **Delivery** application.
2. Click **URLs > Redirects**. The Redirects page opens.
3. Select the website you want to activate redirects for.
4. Click **Activate**. The Activate version window opens, displaying the number of added, modified, or deleted rules.
5. Click **Activate** again. The system activates your ruleset, during which time the screen is locked for changes.

## Downloading your redirect rules

You can download your current redirect rules to review them in another format or to make changes and re-upload.

1. Navigate to the **Delivery** application.
2. Click **URLs > Redirects**. The Redirects page opens.
3. Select the website you want to download redirects for.
4. To download the latest set of rules, click ![icon_ellipsis.png](https://docs.arcxp.com/images/learning-center/image/img-36e988534106c557aab2119deabbbed2.png) **\> Download rules**.  
To download a previous version of rules for this site, click ![icon_ellipsis.png](https://docs.arcxp.com/images/learning-center/image/img-36e988534106c557aab2119deabbbed2.png) **\> Show version history**. Then on the version you want to download, click ![icon_ellipsis.png](https://docs.arcxp.com/images/learning-center/image/img-36e988534106c557aab2119deabbbed2.png) **\> Download rules**.  
The system downloads a CSV file containing your rules to your computer.

## Reactivating a previous redirect rule version

You can reactive a previous version of your rules. You may need to revert to a previous version to undo changes or because you no longer need the most recent version.

1. Navigate to the **Delivery** application.
2. Click **URLs > Redirects**. The Redirects page opens.
3. Choose the website you want to set redirect rules for.
4. Click ![icon_ellipsis.png](https://docs.arcxp.com/images/learning-center/image/img-36e988534106c557aab2119deabbbed2.png) **\> Show version history**. The Version history pane opens.
5. Navigate to the version you want to reactive, and click ![icon_ellipsis.png](https://docs.arcxp.com/images/learning-center/image/img-36e988534106c557aab2119deabbbed2.png) **\> Reactive version**.
