BunStackDocs

Storefronts

Redirects

Lead old addresses right: your own rows, CSV, slug changes, the 404 list, testing addresses and the preset for moving from WooCommerce.

Last updated · 7 min read

A redirect leads an old address to a new one.

Where: Storefronts › [storefront] › Redirects.

A redirect runs only where the storefront would otherwise answer 404. A page that exists never changes.

TypeWhen
301 permanentThe default. Search engines move the page's ranking to the new address
302 temporaryFor addresses that will change again, for example /my-account → /orders until customer accounts exist. Browsers and CDNs do not store it

The visitor's query string, for example ?utm_source=…, is passed on to a page in the storefront when the target has none of its own. BunStack removes order keys, sign-in tokens and email addresses, for example key, order_id, t and email. Nothing is passed on to another website.

Add a redirect

  1. Press Add redirect.
  2. Fill in Old path. You can paste a whole URL.
  3. Fill in New path, or a whole address on another website.
  4. Choose Type.
  5. Press Save.

BunStack removes the domain, the query string and a trailing slash from the old path and saves it in lowercase.

  • End the old path with /* to cover everything under it.
  • A * in the new path gets what matched. /product/* → /products/* leads /product/blue-shirt to /products/blue-shirt.
  • Without * in the target, every address goes to the same page.
  • A row for an exact path goes before a /* row. Of two /* rows, the longest wins.

Edit changes the target and the type. Delete removes the row.

RefusedCause
/ as old pathThe home page always answers
A row that leads back to itselfBy itself or via its own /*
A → B when B → A existsIt would be a loop

Import and export

Import CSV reads one row per redirect: from,to and optionally a third column.

RuleValue
Third column301, 302, permanent or temporary
Header rowSkipped
SemicolonWorks, as in Swedish Excel
Old path that already existsReplaced
Max per file5 000 rows

Refused rows lists the refused rows with the cause. BunStack saves the other rows.

Export CSV gives the same format plus source, hits and last hit. You can import the file again.

When a slug changes

  • When an active product changes slug, BunStack creates /products/old → /products/new on every storefront that shows the product.
  • When a category changes slug, BunStack creates /category/old → /category/new on every storefront in the workspace.

The rows have the source Slug change. BunStack points rows that led to the old address on to the new one, so there are no chains. When you change back there is no loop. A product that has only been a draft gets no row.

The 404 list

404s, last 14 days shows paths that answered 404 without a redirect. The list shows the number of hits, the number of days and when the path was last seen.

  • Add redirect puts the path in the form above.
  • Dismiss removes the path until it answers 404 again.
  • A path that a new redirect covers leaves the list.
LimitValue
New paths per storefront and day500. The rest are collected under Other paths
Scanner attemptsNot counted, for example /wp-login.php, /.env and *.php
Kept90 days
Details about the visitorNone. No IP addresses are saved

After a move: go through the list every day for the first 14 days. Add a row for every old address that shows up.

Test URLs

  1. Paste old addresses or paths in Test URLs, one per line. An export from Search Console works.
  2. Press Test.

BunStack calls each address on the published storefront and follows the redirects one at a time, as a search engine does. It tests long lists 25 at a time, with a counter. When a batch fails, the finished results stay and the rest count as not tested. The test needs the storefront to be live.

ResultMeans
OKAnswers 200 after at most 2 redirects
Leaves the shopLeads on purpose to another website
Ends in 404The page does not exist, or the redirect leads to a page that does not exist
More than 2 redirectsA chain. Point the first row at the final target
Redirect loop / ErrorA loop, a server error or no answer

Move from WooCommerce

Move from WooCommerce reads the old shop and suggests redirects. Reading changes nothing in the old shop.

  1. Fill in Old shop address.
  2. When the storefront has a separate front end, for example Nuxt or Next, fill in the WordPress address in WPGraphQL address.
  3. Fill in Old product feed path (optional) when the old shop had a product feed.
  4. Press Read old shop.
  5. Go through the suggestions. Change or untick rows.
  6. Choose the target in Unmatched URLs go to.
  7. Press Import.

BunStack reads the sitemap (/sitemap.xml, /sitemap_index.xml or /wp-sitemap.xml). With the WPGraphQL plugin, it also reads products, categories and pages. When WPGraphQL does not answer, or the site's firewall blocks the request, the sitemap is enough. What it could not read shows under the button.

BunStack suggests a row for every old address that would otherwise give 404:

Old addressNew address
/product/<slug>/products/<slug>. BunStack follows WordPress duplicates (blue-shirt → blue-shirt-3). A product that is hidden here goes to its category and is marked for checking
/product-category/<slug>/category/<slug>. The category's later pages, such as /page/2, go to the same place
/shop, /butik, /all-products, /alla-produkter and their later pages, such as /shop/page/<n> and /products/page/<n>/products, the page with all products
/pages/<slug> or /<slug>The page with the same slug. A policy page for shipping, returns, terms or privacy goes to the storefront's page of the same kind
/my-account and /my-account/*/orders, as 302 until customer accounts exist
/my-account/view-order/*, /checkout/order-received/*, on a Nuxt front end /order-summary/* and /confirmation, and the returns pageThe withdrawal form for orders from the previous shop
The old feed's path, if you give it/api/feeds/google.xml

Addresses that already lead to the right page need no row of their own. Three rows cover unknown addresses: /product/* → /products/*, /product-category/* → /category/* and, for a separate front end, /pages/* → /*.

  • Addresses without a match go to Unmatched URLs go to. The default is the home page.
  • The page lists old top categories without a match, each with a target of its own. A target on a parent also moves the subcategories and their products.
  • A row with a yellow note needs checking: a hidden product, a similar slug or a policy page without a match.
  • BunStack saves nothing until you press Import.

After the import, Test the old addresses puts the old shop's addresses in Test URLs. That covers the sitemap's addresses and every product, category and page read via WPGraphQL.

Note: The withdrawal form for earlier orders answers only when Orders from your previous shop is on under Storefronts › [storefront] › Returns. See Returns.