Skip to main content
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.vm template 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​

CommandWhat it does
sf redirects list, get, resolveList rules, read one, or follow what a shopper gets for a path
sf redirects add, updateCreate one 301 redirect, or change a rule
sf redirects import, exportBring rules in from a CSV with a dry run, or write every rule to a CSV
sf redirects delete, restoreDelete one rule, or many with a dry run and a backup, and put backed-up rules back
sf not-found list, show, summaryThe top missed paths, one path's recent hits, and the 404 trend
sf not-found ignore, fixed, remove, exportHide or resolve missed paths, or export them as a redirect CSV to fill in
sf not-found pageRead 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.

Was this page helpful?