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 (formerly LovableHTML) 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
- Go to Site Settings
- Open the Redirects accordion under
CACHE & ROUTING - Click Add Redirect, fill in
FROMandTO, 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:
/old-blog/2024/seo-tips → /blog/2024/seo-tips
Reorder URL segments:
/author/jane/post/intro → /post/intro/by/jane
Collapse a category into a flat URL:
/category/shoes/item/red-runner → /shop/red-runner
Redirect to an external site:
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.
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.
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 mismatch —
/aboutand/about/are different paths. Add separate rules or normalize on your origin. - 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.
