> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scayla.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding redirect rules

> Redirect rules use URL patterns to automatically redirect multiple similar URLs at once. Instead of creating individual redirects for each URL, one rule can handle hundreds or thousands of redirects.

## What are redirect rules?

Redirect rules are pattern-based redirects that match groups of 404 URLs using wildcard variables. When a visitor accesses a URL matching your pattern, the rule automatically redirects them to your specified destination.

<Info>
  Redirect rules only work on broken links that return a 404 error. They cannot
  redirect active pages. If you need to redirect visitors from an active page,
  use a [live redirect](/redirect-pro/guides/using-live-redirects/create-live-redirect)
  instead.
</Info>

**Example use case:**

* You have 50 products with URLs like `/products-old/shirt`, `/products-old/pants`, `/products-old/jacket`
* Instead of creating 50 individual 301 redirects
* Create one redirect rule: `/products-old/*` → `/products/*`
* This handles all 50 products with a single rule

<Info>
  Redirect rules count toward your **tracked visits quota** each time they're
  activated. [301 redirects](/redirect-pro/guides/managing-301-redirects/create-301-redirect)
  don't count toward quotas and are unlimited on all plans.
</Info>

## Redirect rules vs. 301 redirects vs. live redirects

| Feature          | 301 Redirects             | Redirect Rules                       | Live Redirects                       |
| ---------------- | ------------------------- | ------------------------------------ | ------------------------------------ |
| **Works on**     | Broken pages (404 errors) | Broken pages (404 errors)            | Active pages                         |
| **Best for**     | Specific individual URLs  | Multiple similar URLs                | Redirecting between active pages     |
| **Setup**        | One redirect per URL      | One rule for many URLs               | One redirect per URL                 |
| **Quota usage**  | Unlimited (doesn't count) | Counts toward monthly tracked visits | Counts toward monthly tracked visits |
| **SEO benefits** | Yes — permanent signal    | No                                   | No                                   |
| **Speed**        | Instant (server-side)     | Brief delay (JavaScript)             | Brief delay (JavaScript)             |

<Tip>
  **When to use each:**

  * Use **301 redirects** for permanent, high-traffic URL changes where the original page is broken (404) and you want SEO benefits
  * Use **redirect rules** for managing many broken URLs that follow a pattern
  * Use **[live redirects](/redirect-pro/guides/using-live-redirects/live-redirects-overview)** when you need to redirect visitors from an active page that must remain live
</Tip>

## Types of redirect rules

### Starting from a template

Pre-built patterns for common redirect scenarios. Just select a template and customise the destination to your needs.

**Available templates:**

* **Products** - Redirect any broken product page to your homepage (`/`)
* **Collections** - Redirect any broken collections page to the all collections page (`/collections`)
* **Pages** - Redirect any broken page to your homepage (`/`)
* **Blog** - Redirect any broken blog to the blogs homepage (`/blogs`)

**When to use**: Quick setup for standard redirect patterns without writing custom rules.

### Custom rules

Build your own pattern using wildcard tokens for complete control.

**When to use**: Unique URL structures that don't match pre-built templates.

## How redirect rules work

Redirect rules run JavaScript in the visitor's browser to send them to a new page. **They don't help with SEO** because search engines can't follow JavaScript redirects.

<Tip>
  **Want SEO benefits?** Use [301
  redirects](/redirect-pro/guides/managing-301-redirects/create-301-redirect) instead, or
  [convert rule matches to
  301s](/redirect-pro/guides/working-with-redirect-rules/view-manage-rule-matches) with the
  Enterprise plan.
</Tip>

### The two parts of a redirect rule

**1. Redirect from (what URLs to redirect)**

The pattern you're looking for, using wildcard tokens that match any text:

* Use wildcard tokens: `⑴` `⑵` `⑶` `⑷` `⑸` (you can use up to 5)
* Each token matches any characters
* You must use at least one token in your "Redirect from" URL

**Example**: `/category/⑴` matches `/category/shirts`

**2. Redirect to (where to send them)**

The destination URL. Include wildcard tokens to preserve parts of the original URL:

* **Static redirect**: `/collections/all` (everyone goes to the same place)
* **Dynamic redirect**: `/collections/⑴` (preserves the matched text)

**Example**: Match `/category/⑴` and redirect to `/collections/⑴`

* Visitor goes to: `/category/shirt`
* Gets redirected to: `/collections/shirt`
* The `⑴` captures "shirt" and reuses it

### Using multiple wildcard tokens

**Match**: `/blog/⑴/posts/⑵`\
**Redirect to**: `/news/⑴/⑵`

**Result**: `/blog/2024/posts/announcement` → `/news/2024/announcement`

Each wildcard (`⑴`, `⑵`, `⑶`, etc.) captures a different piece in order and you can reuse them in the destination.

### Rule matching example

**Redirect from**: `/categories/⑴`

**Matches these URLs**:

* `/categories/summer` ✓
* `/categories/winter-sale` ✓
* `/categories/anything-here` ✓

**Doesn't match**:

* `/collections/summer` ✗
* `/products/shirt` ✗

## Rule matches (Enterprise feature)

<Tooltip tip="See URL visits that triggered redirect rules and convert them into permanent 301 redirects for better SEO performance">
  Rule matches
</Tooltip>

show the actual URLs visitors accessed that triggered your redirect rules.

**What you can see:**

* Real URLs that matched your rule
* Where visitors were redirected to
* How many times each URL was visited

**What you can do:**

* Review which "to" and "from" URL pairings are actually being visited
* Convert high-traffic matches into permanent 301 redirects
* Optimize your redirect strategy based on real data

<Note>
  This feature is only available on the **Enterprise plan**. See [View and
  manage rule
  matches](/redirect-pro/guides/working-with-redirect-rules/view-manage-rule-matches) for
  details.
</Note>

## When to use redirect rules

<AccordionGroup>
  <Accordion title="Shopify migrations">
    You're migrating to Shopify which changes your URL structures (e.g., `/product/` to `/products/`) and need to redirect hundreds of URLs at once.

    **Use redirect rules** to handle all URLs with a few rules instead of creating individual redirects.
  </Accordion>

  <Accordion title="Discontinued Shopify markets">
    You're closing a market and need to redirect all country-specific URLs to your primary store.

    **Use redirect rules** with market-specific patterns. See [Use redirect rules for discontinued markets](/redirect-pro/guides/working-with-redirect-rules/redirect-rules-markets).
  </Accordion>

  <Accordion title="High-volume URL changes">
    You're managing thousands of URLs that follow a predictable pattern.

    **Use redirect rules** to handle them efficiently with a single rule instead of thousands of 301s.
  </Accordion>
</AccordionGroup>

## Redirect rule best practices

<Accordion title="Start with templates when possible">
  Templates are pre-tested patterns that cover common scenarios. Use them first
  before building custom rules.
</Accordion>

<Accordion title="Test rules before going live">
  Always test your redirect rule with a few sample URLs to ensure it redirects
  correctly. See [Test redirect
  rules](/redirect-pro/guides/working-with-redirect-rules/test-redirect-rules).
</Accordion>

<Accordion title="Monitor your quota usage">
  Each time a rule is triggered, it counts toward your monthly tracked visits.
  Check your usage regularly if you have high-traffic redirect rules.
</Accordion>

<Accordion title="Convert high-traffic rules to 301s">
  If certain URLs in your rule get consistent traffic, Enterprise users can
  convert them into individual 301 redirects for better SEO and unlimited
  visits.
</Accordion>

<Accordion title="Keep rules simple">
  Complex patterns with many wildcard tokens can be hard to maintain. If a rule
  becomes too complicated, consider breaking it into multiple simpler rules or
  using 301 redirects instead.
</Accordion>

## Next steps

<CardGroup cols={2}>
  <Card title="Create a redirect rule" icon="plus" href="/redirect-pro/guides/working-with-redirect-rules/create-redirect-rule">
    Set up your first redirect rule
  </Card>

  <Card title="Test redirect rules" icon="flask" href="/redirect-pro/guides/working-with-redirect-rules/test-redirect-rules">
    Verify rules are working as expected
  </Card>

  <Card title="Edit or delete rules" icon="pen" href="/redirect-pro/guides/working-with-redirect-rules/edit-delete-redirect-rules">
    Manage existing redirect rules
  </Card>

  <Card title="View rule matches (Enterprise)" icon="chart-simple" href="/redirect-pro/guides/working-with-redirect-rules/view-manage-rule-matches">
    See which 404 URLs triggered your rules
  </Card>
</CardGroup>

## Related guides

* [Create a redirect](/redirect-pro/guides/managing-301-redirects/create-301-redirect) - Set up permanent 301 redirects
* [Understanding usage quotas](/redirect-pro/guides/account-and-settings/usage-quotas) - Learn about tracked visits limits
* [Convert matches into permanent redirects](/redirect-pro/guides/working-with-redirect-rules/view-manage-rule-matches) - Optimize your redirect strategy

## Need help?

If your redirect rule isn't working as expected, see our troubleshooting guide:

* [Redirect rule not working](/redirect-pro/help/redirect-rule-issues/redirect-rule-not-working) - Common issues and fixes
