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-name to /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

CodeNameUse Case
301Moved PermanentlyPage has permanently moved; passes most link equity
302Found (Temporary)Temporary redirect; does not pass link equity
307Temporary RedirectTemporary; preserves original HTTP method
308Permanent RedirectPermanent; 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=spring

Adding Redirects

Single Redirect

Click Add Redirect in the Redirects tab to create a redirect manually:

FieldDescription
Source pathThe path to match (e.g. /old-page or ^/blog/([0-9]+)/.*$)
DestinationWhere to redirect (e.g. https://www.example.com/new-page)
Typeexact or regex
Status code301, 302, 307, or 308
Preserve query stringWhether to append the original query string
PriorityFor regex redirects, lower numbers are evaluated first
EnabledEnable 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
ColumnRequiredValues
sourceYesPath string or regex pattern
destinationYesFull destination URL
typeYesexact or regex
status_codeYes301, 302, 307, 308
preserve_query_stringYestrue 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/$1

In 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:        301

Redirect with URL slug preservation

Source:      ^/products/detail/([a-z0-9-]+)$
Destination: https://www.example.com/shop/$1
Type:        regex
Code:        301

/products/detail/blue-widgethttps://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-posthttps://www.example.com/blog/my-first-post

On this page