↑↓ selectEnter openEsc close

    1. Elbuz

    How to set up 301 redirects and get rid of 404 errors

    11 min readUpdated

    The “Redirects” module 301-redirects old page addresses to new ones: an old link opens the right page, and search engines move its rankings there. Rules work once saved.

    When you need this:

    • A discontinued product's page is still in Google — redirect it to the new model or category.
    • You renamed a section — one mask redirects all its old addresses.
    • You moved from another site — paste “old new” pairs or .htaccess lines at once.
    • Customers see “Page not found” — the 404 log lists them; make a rule from a row.

    Where to start: “Store settings” → “SEO & URLs” → the “Redirects” card → “Add rule”.

    What the redirects module can do

    How to redirect an old address to a new one

    1. Open the module. “Store settings” → the “SEO & URLs” section → the “Redirects” card.
    2. Check the “Enabled” switch at the top of the screen. A disabled module runs no rules but keeps them. The switch is saved with the “Save” button at the bottom of the window.
    3. Click “Add rule” on the “Rules” tab.
    4. Fill in “From” and “To”. “From” is the old address without the site name, for example /iphone-13. “To” is the new address in this store; / is the home page.
    5. Choose the “Type”. If the page has moved for good, leave “301 — permanent”.
    6. Click “Save” in the rule card. The rule goes to the store right away: you'll see “Saved and applied in the store”.
    Redirects screen with the Rules tab: header with the Enabled switch and the table of five rules
    1Enabled switch
    2Add rule
    3Add as a table
    4Scheduled state
    5Delete rule
    1. Turns all of the store's redirect rules on and off together.
    2. Creates a new "from → to" rule.
    3. Adds many rules at once: address pairs, CSV or .htaccess lines.
    4. The rule is set for the dates of a promotion and has not started yet.
    5. Deletes the rule from the store right away, after confirmation.

    You can also paste the full address with your site name — the app strips the name itself. An address on another site isn't accepted in either “From” or “To”.

    The rule's status is shown in the “State” column:

    StateWhat it means
    ActiveThe rule is working now
    Off“Enabled” is cleared in the rule card: the rule exists but doesn't fire
    ScheduledThe “Active from” date hasn't come yet
    EndedThe “Active until” date has passed

    “Search by address” looks in both “From” and “To”. The trash can icon in a row deletes the rule from the store immediately, after you confirm.

    301 or 302: which type to choose

    TypeWhen to use it
    301 — permanentThe page has moved for good. Search engines move the old address's rankings to the new one. If in doubt, pick this one
    302 — temporaryA sale or a seasonal page: the old address stays in search
    307, 308The same as 302 and 301, but the request method is kept
    303 — see otherA rare case: the response “see another page”

    A rule for the duration of a sale

    Set “Active from” and “Active until” in the card. Both dates are inclusive; an empty one means no limit. For a sale, use type 302.

    Before the first day the rule shows as “Scheduled”, after the last one as “Ended”. It switches on and off by itself, based on the store's date.

    How to redirect a whole section

    An asterisk * in “From” turns the rule into a mask for a group of addresses:

    “From”Which addresses it redirects
    noutbuky/*All that start with noutbuky/
    *.htmlAll that end with .html
    *promo*All that contain promo

    A mask works when the asterisk is at the edge of the address; the app won't accept one in the middle. For a more complex pattern, use a regular expression.

    A mask sends all addresses to one place. To send each old page to its own new one, turn on “Regular expression”. With “From” ^telefony/(.*) and “To” smartphone/$1, the address telefony/samsung-a15 goes to smartphone/samsung-a15.

    Rule window for the regular-expression rule with From, To, Type and date fields
    1From field
    2Regular expression switch
    3To field
    4Type
    5Active from / Active until
    1. The expression; the part in parentheses is carried into "To".
    2. "From" is read as a pattern, not as a single address.
    3. $1 is replaced by the part of the address captured in parentheses.
    4. 301 means the page has moved permanently.
    5. Empty means the rule always applies.

    Parts in parentheses are substituted into “To” as $1, $2. The expression is case-insensitive. It looks for a match anywhere in the address: without ^ at the start, telefony/(.*) also matches mobilni-telefony/….

    Which rule fires when several match

    An exact rule beats a mask, and a mask beats a regular expression; rules that are off or outside their dates today are skipped
    noyesyesnoyesnoyesnoA customer or search engine opensa store addressIs the module enabled?The page opens as isAd tags are removed from theaddress: utm, gclid and othersIs there an exact rule for thisaddress?Redirect to “To” with the rule's typeDoes an asterisk mask match?Does a regular expression match?The page opens; if it doesn't exist —a row in the 404 log
    • Start or end
    • Action or result
    • Decision: the path depends on the answer
    • Key step
    • Exact rules first, then masks, then regular expressions. Among masks and among expressions, the one higher in the list is checked first; a new rule goes to the top. So the mask staryi-katalog/* → katalog and exact rules for your key products work together: the exact ones fire first.
    • A rule fires before the page. If a page with the “From” address exists, it will no longer open.
    • A rule also fires on an address with parameters. A rule for /iphone-13 fires on both /iphone-13?page=2 and /iphone-13?utm_source=facebook&page=2. Ad tags — any utm_…, plus gclid, fbclid and srsltid — are removed before the check wherever they appear in the address; other parameters stay.
    • After an exact rule or a mask, only “To” carries over to the new address. Parameters of the old address, including utm tags, are not passed on.

    How to move many addresses at once

    On the “Rules” tab, click “Add as a table” and paste the rules, one per line. You can mix formats:

    LineWhat you get
    /stara-storinka /nova-storinkaAn exact 301 rule
    stara,nova,302,1 or stara;novaCSV: from, to, type, status. Type and status are optional; status 1 means enabled, 0 disabled
    Redirect 301 /old /newAn .htaccess line. With no code, and with Redirect permanent — 301; Redirect temp and RedirectTemp — 302
    RedirectMatch 301 ^/old/(.*)$ /new/$1A regular expression; with no code — type 302
    RewriteRule ^old$ /new [R=301]A simple pattern becomes an exact rule, a pattern with special characters becomes a regular expression. Without R=301 — type 302
    The
    1Supported formats
    2Rules field
    3Add button
    1. The formats the program understands: pairs of addresses, CSV lines, and .htaccess lines.
    2. One rule per line; formats can be mixed.
    3. Saves all valid lines and shows the lines with errors together with the reason.

    Empty lines, lines starting with # and the from,to header are skipped. Other .htaccess lines — RewriteCond, RewriteEngine, Redirect gone — are skipped with the reason “Line not recognized…”. If the same “From” already exists, the rule is updated.

    A line with an error is skipped; the rest are saved in one go. The app shows “Added: N, updated: M”, and below the field — “Lines skipped: N” and “Line N: text — reason”.

    Which rules the store will reject

    A rule that would break the site isn't saved. The reason appears under the field in the card:

    What you enteredText under the field
    “From” is /, * or empty“The home page or every page cannot be redirected”
    A service address: admin panel, files, cart, checkout, account“A service address of the store (files, cart, account) cannot be redirected”
    An address on another site in “From”“Only an address of this store, not another site”
    Another site in “To”“The target is a page of this store, not another site”
    “To” is the same as “From”“The same page as “From””
    That “From” already exists“A rule with this “From” address already exists”
    An asterisk in the middle of the address“The asterisk * goes only at the start or end of the address; for a more complex pattern turn on “Regular expression””
    Spaces or an address that's too long: over 512 Latin characters, half that in Cyrillic“Up to 512 characters, no spaces”
    A regular expression with an error“Invalid regular expression”
    An expression that matches any page, like .*“The expression matches every page”
    Empty “To”“Enter where to send (/ is the home page)”
    “Active until” is earlier than “Active from”“Before the start date”
    A circle of rules: A → B and B → A“A redirect loop”
    The rule window with an error under the
    1Error under the To field
    2Message at the bottom of the window
    1. The reason for the refusal is shown under the field that needs fixing.
    2. While the field is not fixed, the rule is not saved.

    The store itself checks for loops, so such a rule is already in the list. While it's there, the store accepts no rule changes at all — neither new rules nor deletions — and “not applied” appears next to the “Add rule” button. Fix “To” or delete the rule.

    How to find broken links in the 404 log

    The “404 log” tab lists store addresses where customers and search engine bots didn't find a page. The most frequent come first, for the last 30 days. For another period, use the “From” and “To” fields and “Show”.

    404 log tab: date range, clear buttons and the table of missing addresses
    1From / To dates
    2Hits count
    3Create rule
    4Has a rule
    5Clear resolved
    1. The log period, the last 30 days by default.
    2. How many times the address was opened; the most frequent are on top.
    3. Opens the rule card with the address already filled in "From".
    4. An exact rule already exists for this address.
    5. Removes rows that already have a rule and ignored rows.
    • “Hits” — how many times the address was opened; “Last” — the date of the last visit. Hover over the address to see “Came from:” and the page visitors first came from.
    • “Create rule” (the icon in the row) opens a rule card with “From” already filled in. Once you save an exact rule, the row changes to “Has a rule”.
    • “Ignore” — for bot addresses that never existed on the site. The row turns gray and shows “Ignored”. “Stop ignoring” brings it back.
    • “Clear resolved” removes rows with a rule and ignored ones. “Clear all” deletes the whole log — it can't be restored.

    The counter next to “404 log” shows addresses that have no rule and aren't ignored. Up to 500 rows are shown; if the period has more, you'll see “Showing 500 of N” at the bottom.

    The store writes the log only while the module is enabled. It records the “not found” page and non-existent products, categories, manufacturers or articles.

    Not recorded: the service sections admin, image, system, .well-known and the files robots.txt, favicon.ico and the sitemap sitemap….xml. Ad tags are removed from the address, so a rule created from a log row also works on links from ads.

    Scenarios

    Home appliances: a model was discontinued

    The X100 washing machine is no longer made, but people still find its page in Google. Rule pralna-mashyna-x100 → pralni-mashyny/pralna-mashyna-x200, type 301. You can disable or delete the X100 product — the rule works without it.

    Electronics: a section was renamed

    “Mobile phones” became “Smartphones”, and the address changed from mobilni-telefony to smartfony. The exact rule mobilni-telefony → smartfony handles the section itself.

    The regular expression mobilni-telefony/(.*) → smartfony/$1 sends each product to its new address if product addresses didn't change. If they did, use the mask mobilni-telefony/* → smartfony.

    Moving from an old site

    The old addresses contain .html. Paste the “old new” pairs via “Add as a table”. For everything else, add the mask *.html → /: the exact rules from the table fire first, and everything else goes to the home page instead of an error.

    Regular expressions are checked after the mask, so the mask will intercept RewriteRule lines with patterns. Move those addresses as exact pairs instead.

    Pet supplies: a short address for flyers

    Rule rozprodazh → the discounted pet food category, type 302, “Active from” — the first day of the sale, “Active until” — the last. The rule switches on and off by itself, and you can point the address on the flyers elsewhere without reprinting them.

    Once a week: the 404 log

    Open the “404 log” for the last week. For genuine old pages, use “Create rule”; for bot junk, “Ignore”; then “Clear resolved”. A frequent address with no page is also a hint about which product your catalog is missing.

    What to do when a redirect doesn't work

    What you seeWhyWhat to do
    The old address opens the page or “not found” instead of the new one The module is disabled, the rule is “Off”, “Scheduled” or “Ended”, or another rule fires first Check “Enabled” at the top, the rule's “State” and whether there's an exact rule for this address (check order)
    You changed or deleted a rule, but the browser still goes to the old target The browser remembers a 301 and redirects on its own without asking the store Check in an incognito window
    “not applied” next to the “Add rule” button, or “Saved, but the store rejected it: …” The list contains a rule the store rejected, most often a loop Open the rule — the reason is under the field. Fix the field or delete the rule (which rules the store will reject)
    “The store has not been updated yet to the module version where rules are managed in the app”, and the “Add rule” and “Add as a table” buttons are inactive The store's module is still an older version: Elbuz updates modules itself together with theme releases Wait: the update comes with the next release, usually within a day. If it takes longer, contact Elbuz support
    “No 404 addresses for this period”, although there are broken links The module is disabled, so the log isn't written, or the addresses are outside the period Enable the module and widen the “From” — “To” range

    FAQ

    I deleted a product in Elbuz — will a rule for its address appear automatically?

    No. Deleting a product or category doesn't create a rule. Add one manually, for example to the product's category, or from the 404 log.

    Can I redirect to another site or domain?

    No, “To” can only be an address in this store. To redirect an old domain to a new one, use the domain settings at your registrar.

    What happens to the rules if I disable the module?

    No rule fires, and the 404 log isn't written. The rules are kept: enable the module and everything works again.

    Do I need to re-enter rules that were already in the store?

    No. The first time you open the screen, the app pulls them into the “Rules” list by itself.

    I made a mask from a log row — why didn't the row change to “Has a rule”?

    “Has a rule” is set only by an enabled exact rule with the same address. A mask or regular expression does redirect, but the row stays “404” — mark it “Ignore”.

    Where to find it and who has access

    Menu
    Directories → Operations → Store settings → “SEO & URLs” → “Redirects”
    Access rights
    the “Store settings” window in group permissions
    Prepare
    for a move — a list of old and new addresses

    Related topics

    Was this article helpful?

    Missing a feature? Tell us.

    We will add it for free if other users need it too.

    If only you need it, we will agree on it separately.

    Article contents

    Suggest an improvement

    Try Elbuz free