Encited

301 redirects

What 301 redirects do here#

Page-level 301 redirects forward a specific path (or pattern of paths) to a new destination. The redirect runs at the edge before Encited renders anything, and applies equally to bots, crawlers, and human visitors.

A 301 tells search engines the move is permanent, so:

  • ~90–99% of the old URL's ranking power passes to the new URL
  • The old URL eventually drops out of the index
  • Existing backlinks count for the new page

302s don't pass ranking signal — only use one if the move is genuinely temporary.

This guide is for path redirects. For redirecting www.example.com ↔ example.com, use the Primary domain setting instead — those two redirect types should not overlap.

Where to configure it#

  1. Go to Site Settings
  2. Open the Redirects accordion under CACHE & ROUTING
  3. Click Add Redirect, fill in FROM and TO, save

The first matching rule wins, so order matters when patterns overlap.

Path patterns: * and **#

Sources are matched by glob-style path patterns, not regex. Two wildcards are supported, and each one must be a whole path segment — /blog/* is valid, /blog-* is not.

Token Matches Example
* One single path segment /blog/* matches /blog/hello but not /blog/2024/hello
** The rest of the path (zero or more segments) /old/** matches /old, /old/a, /old/a/b/c

Rules:

  • Patterns must start with /
  • ** may only appear as the last segment
  • Sources cannot contain ? or # unless you're using an exact-match query redirect

Capture placeholders: $1, $2, …#

Every wildcard in the source becomes a numbered capture. Reference it in the destination with $N — $1 is the first wildcard, $2 the second, and so on. ** captures the entire remaining path as a single string (without a leading slash).

Examples#

Rename a path prefix and keep the rest:

FROM TO
/old-blog/** /blog/$1

/old-blog/2024/seo-tips → /blog/2024/seo-tips

Reorder URL segments:

FROM TO
/author/*/post/* /post/$2/by/$1

/author/jane/post/intro → /post/intro/by/jane

Collapse a category into a flat URL:

FROM TO
/category/*/item/* /shop/$2

/category/shoes/item/red-runner → /shop/red-runner

Redirect to an external site:

FROM TO
/docs/legacy/** https://docs.legacy.example.com/$1

External destinations are always 301 (we won't issue a 307 to a different origin).

$N only works when the source has at least N wildcards. Referencing $2 against a source with one * is a save-time error. Patterns without wildcards have no captures to substitute.

Exact-match redirects for legacy query strings#

Path patterns can't include ?, so to redirect a legacy URL like /old.asp?id=42 you need to put the full literal string (path + query) in the source. The redirect engine detects the ? and switches to exact-string matching for that rule — no wildcards, no captures.

FROM TO
/old.asp?id=42 /products/widget-42

This is the only way to discriminate between two URLs that share a path but differ on query — useful for migrating off .asp, .php, or any CMS that encoded IDs into the query string.

Captures don't work in exact-match rules. The destination cannot contain $1, $2, etc. when the source has a ? — there's nothing to capture. This is enforced at save time.

Add or remove a trailing slash#

Redirect rules match a path with and without its trailing slash as the same path. One rule covers both spellings, and it never loops: when the destination is the URL that was requested, the rule is skipped and the page is served.

Add a trailing slash to one page:

FROM TO
/pricing /pricing/

/pricing → 301 to /pricing/. /pricing/ is served as-is.

Remove it instead:

FROM TO
/pricing/ /pricing

/pricing/ → 301 to /pricing. /pricing is served as-is.

Remove it across the whole site#

One rule covers every path:

FROM TO
/** /$1

/blog/2024/hello/ → 301 to /blog/2024/hello. Paths that already have no trailing slash are served as-is, and so are the homepage, /sitemap.xml, and your CSS, JavaScript, and image files, because none of them end in a slash.

Adding one across the whole site#

There is no safe single rule for the add direction. /** → /$1/ matches every request, not only your pages:

Request Result
/pricing 301 to /pricing/ — what you wanted
/ 301 to //
/sitemap.xml 301 to /sitemap.xml/
/assets/app.js 301 to /assets/app.js/

A redirected stylesheet or script never loads, so that last row can leave visitors looking at an unstyled or blank page. Add the slash per page instead, or per section where the section holds pages only:

FROM TO
/pricing /pricing/
/blog/** /blog/$1/

The homepage needs no rule, since / already ends in a slash. Files you host through Encited, such as a managed sitemap.xml or robots.txt, are served before redirect rules run and are never affected either way.

Your host must serve the form you redirect to. If your host redirects /pricing/ back to /pricing, an add-slash rule loops. Pick one form, check that the host serves it without redirecting, then add the rule.

curl -sI https://example.com/pricing
# HTTP/2 301
# location: https://example.com/pricing/

Avoid redirect chains#

A chain happens when a redirect points to another redirect:

/old → /middle → /final

Each hop loses a small amount of ranking signal and adds latency. Always point directly to the final destination:

/old → /final
/middle → /final

If you've accumulated chains over the years, audit them with the SEO Spider — it flags multi-hop redirects.

Verify a redirect#

curl -sI https://example.com/old-path
# Expect:
# HTTP/2 301
# location: /new-path

For redirects with captures, hit a path that exercises the wildcard:

curl -sI https://example.com/old-blog/2024/hello
# location: /blog/2024/hello

Common mistakes#

  • Overlapping rules — /blog/* and /blog/** will both match /blog/hello. The more specific rule should come first; first match wins.
  • Trailing slash fights with the host — a rule that adds a slash while the host removes it (or the reverse) loops. See Add or remove a trailing slash.
  • Forgetting to update the sitemap — redirected URLs should be removed from the sitemap; the new URLs should be in it.
  • Redirecting to a 404 — we don't validate that the destination exists. Test the new URL before you ship the rule.