Reference
Redirects and 404 pages
Overview
Your agent can manage the StoreFront's redirect rules and the paths shoppers asked for that answered "page not found" (404). Use it when you move or remove a page, migrate a site to UltraCart, or clean up broken links.
- Redirect rules written by the CLI are real HTTP 301 (permanent) redirects. They take effect at once; there is no draft step. The only pattern is a trailing
*, such as/old/*, which carries the rest of the path onto the target. - Missed paths are the addresses that answered 404, with hit counts and recent hits. The agent can fix one with a redirect, mark one fixed, or hide scanner noise.
- The 404 page is the
site_404.vmtemplate the active theme renders.
Example requests
- "List the 20 most-hit paths that answered 404, ignoring bots, and suggest the closest live page for each."
- "Import these 300 redirects from the old site's CSV. Show me the dry run first."
- "The /sale/ page moved to /deals/. Redirect the old address and anything under it."
- "Check what a shopper gets for /old-catalog/boots.html."
Commands
| Command | What it does |
|---|---|
sf redirects list, get, resolve | List rules, read one, or follow what a shopper gets for a path |
sf redirects add, update | Create one 301 redirect, or change a rule |
sf redirects import, export | Bring rules in from a CSV with a dry run, or write every rule to a CSV |
sf redirects delete, restore | Delete one rule, or many with a dry run and a backup, and put backed-up rules back |
sf not-found list, show, summary | The top missed paths, one path's recent hits, and the 404 trend |
sf not-found ignore, fixed, remove, export | Hide or resolve missed paths, or export them as a redirect CSV to fill in |
sf not-found page | Read the 404 template the active theme renders |
Safety checks
The server refuses redirect loops, chains longer than five rules, duplicate sources, system paths, missing or off-site targets, and a rule over a live page unless the agent passes --over-live-page with your agreement. The agent checks every change with sf redirects resolve. Writes need --live and publish permission.
What it cannot do
- Use regular expressions. A trailing
*is the only pattern. - Redirect to another domain. Rules stay on the storefront's own hosts.
- Write 302 or rewrite rules. Rules written here are always 301s. Rules made in the admin as 302 or rewrite show in the list, and can be changed to 301.
What needs approval
Deleting rules with sf redirects delete --ids needs approval for each batch of up to 5,000 rules. Adding, importing and updating rules does not. See Changes that need approval.
Related documentation
- How to customize the 404 error page: editing
site_404.vmin the admin - Pages and themes: moving or hiding a page with a redirect
Was this page helpful?