Redirects
Manage URL redirects at the edge — exact matches, regex patterns, bulk CSV import, and up to 10,000 redirects per domain.
The Redirects feature (also called Legacy URL Saver) lets you manage URL redirects directly in SerpWise, without touching your web server config, .htaccess file, or CDN rules.
Redirects are handled by the gateway before fetching from your origin server — matching requests are returned immediately with the appropriate redirect response, so your origin never sees the traffic and latency is minimal.
When to Use Redirects
- Site migrations — redirect old URLs to new ones after a redesign or CMS change
- URL structure changes — redirect
/old-category/post-nameto/new-category/post-name - Retired pages — redirect discontinued product or service pages to relevant alternatives
- Domain consolidation — redirect from non-www to www, or HTTP to HTTPS (at the path level)
- Affiliate or campaign links — create clean short paths that redirect to longer URLs
How Redirects Work
The gateway uses a two-tier matching system evaluated in order:
Tier 1: Exact Match
Exact redirects use a hash map for O(1) lookup — the path is looked up directly, with no iteration required. This makes exact matches extremely fast regardless of how many redirects you have.
The match is against the URL path only — query strings are not included in the match key, but can optionally be preserved in the redirect response.
Tier 2: Regex Match
If no exact match is found, the gateway evaluates regex redirects in priority order. The first pattern that matches wins.
Regex redirects support capture groups — you can reference captured parts of the URL in the destination using $1, $2, etc.
Redirect Status Codes
| Code | Name | Use Case |
|---|---|---|
301 | Moved Permanently | Page has permanently moved; passes most link equity |
302 | Found (Temporary) | Temporary redirect; does not pass link equity |
307 | Temporary Redirect | Temporary; preserves original HTTP method |
308 | Permanent Redirect | Permanent; preserves original HTTP method |
Use 301 for SEO migrations
For permanent URL changes during site migrations, use 301. This signals to search engines that the old URL has moved permanently and transfers ranking signals to the new URL.
Query String Handling
Each redirect has a preserve query string option:
- Enabled — the query string from the original request is appended to the destination URL
- Disabled — the redirect goes to the exact destination URL with no query string
Example with preservation enabled:
Original: /old-page?utm_source=email&utm_campaign=spring
Destination: /new-page
Result: /new-page?utm_source=email&utm_campaign=springAdding Redirects
Single Redirect
Click Add Redirect in the Redirects tab to create a redirect manually:
| Field | Description |
|---|---|
| Source path | The path to match (e.g. /old-page or ^/blog/([0-9]+)/.*$) |
| Destination | Where to redirect (e.g. https://www.example.com/new-page) |
| Type | exact or regex |
| Status code | 301, 302, 307, or 308 |
| Preserve query string | Whether to append the original query string |
| Priority | For regex redirects, lower numbers are evaluated first |
| Enabled | Enable or disable without deleting |
Bulk Import via CSV
For large redirect lists (site migrations often involve hundreds or thousands of redirects), import a CSV file.
CSV format:
source,destination,type,status_code,preserve_query_string
/old-page,https://www.example.com/new-page,exact,301,false
/blog/2019/.*,https://www.example.com/blog/,regex,301,false
/product/([a-z-]+),https://www.example.com/products/$1,regex,301,true| Column | Required | Values |
|---|---|---|
source | Yes | Path string or regex pattern |
destination | Yes | Full destination URL |
type | Yes | exact or regex |
status_code | Yes | 301, 302, 307, 308 |
preserve_query_string | Yes | true or false |
Importing a CSV adds to your existing redirects — it does not replace them. Duplicate source paths will update the existing redirect.
Export to CSV
Download all your current redirects as a CSV file using the Export button. Use this to:
- Back up your redirect list before making bulk changes
- Edit redirects in a spreadsheet and re-import
- Migrate redirect lists between domains or environments
Limits
Each domain can have up to 10,000 redirects. This limit applies to the total combined count of exact and regex redirects.
For larger redirect requirements, contact support to discuss options.
Priority for Regex Redirects
When you have multiple regex redirects, the gateway evaluates them in priority order (ascending — lower numbers run first). Only the first matching regex is applied; subsequent patterns are not evaluated.
Order matters: put more specific patterns before more general ones.
Priority 1: ^/blog/featured/([a-z-]+)$ → /features/$1
Priority 2: ^/blog/([a-z-]+)$ → /articles/$1In this example, /blog/featured/my-post matches Priority 1 and is redirected to /features/my-post. It never reaches Priority 2.
Regex Examples
Redirect all pages under an old path
Source: ^/old-section/.*$
Destination: https://www.example.com/new-section/
Type: regex
Code: 301Redirect with URL slug preservation
Source: ^/products/detail/([a-z0-9-]+)$
Destination: https://www.example.com/shop/$1
Type: regex
Code: 301/products/detail/blue-widget → https://www.example.com/shop/blue-widget
Redirect dated blog URLs
Source: ^/blog/[0-9]{4}/[0-9]{2}/([a-z0-9-]+)$
Destination: https://www.example.com/blog/$1
Type: regex
Code: 301/blog/2019/04/my-first-post → https://www.example.com/blog/my-first-post