docs
  1. SCAYLE Resource Center
  2. User Guide
  3. Shops
  4. Storefront
  5. Redirects

Redirects

Overview

Redirects can be configured in the SCAYLE Panel, which are then synchronized with the Storefront API and retrieved by Storefront Core. You can read more about the technical details of redirects and how to manage them through the Admin API in the Developer Guide.

Types of redirects

Redirects can be created on both global and country levels. You can set redirects using either an absolute URL or a relative URL.

  • Absolute URLs are best used when you want to redirect from a single, specific URL. For example, if you are no longer selling a certain brand of sweater in your shop, you would want to redirect from the entire URL of that specific listing.
  • Relative URLs are best used when you want to redirect from part of a domain. For example, if you have a category called "Men's Jumpers" in your shop, and you want to rename the category to "Men's Sweaters", you would want to set up a redirect for /men/jumpers to /men/sweaters. This way, every product in the "Men's Jumpers" shop category would be included in the redirect, without needing to create an individual redirect for each listing.

Redirect status codes

CodeNameDescription
301Moved PermanentlyThis and all future requests should be directed to the given URL
302Found Tells the client to look at (browse to) another URI
303See OtherRedirect to another page which does not represent the requested resource
307Temporary RedirectLike 302, but the method and body must not change in the redirected request
308Permanent RedirectLike 301, but the method and body must not change in the redirected request

Redirect Inheritance Rules

The following are some considerations for how redirects operate at the global and shop-country levels:

  • Redirects created on the global shop level are inherited to all country-level shops.
  • Inherited redirects can be edited on the country level. Edited country redirect values will overwrite the global values.
  • Redirects can be created on the country level separately. Redirects created at the country level can't be overwritten and are only valid for the respective shop-country.

Manage redirects

Absolute URL

To create a redirect with an absolute URL:

  1. In the SCAYLE Panel, navigate to Shops > Shop > Storefront > Redirects.
  2. Click New Redirect. Make sure Regex is toggled off.
  3. Enter the Source URL to redirect from.
  4. Enter the Target URL to redirect to.
  5. Enter a Status Code (see table below).
  6. Set the redirect Priority (1 is the highest possible priority).
  7. Click Create.

You must set a priority for your redirect, in case more than one redirect matches the same source URL. If two redirects have the same priority, the redirect with the older creation date will take precedence.

Create a new URL redirect

Relative URL

{% include "../../.gitbook/includes/redirects-regular-expression-info.md" %}

Create a redirect with a relative URL

  1. In the SCAYLE Panel, navigate to Shops > Shop > Storefront > Redirects.
  2. Click New Redirect. Make sure Regex is toggled on.
  3. Enter the Regular Expression to redirect from.
  4. Enter the Target URL to redirect to.
  5. Enter a Status Code (see table above).
  6. Set the redirect Priority (1 is the highest possible priority).
  7. Click Create.

Test regex formatting

You can test whether or not your relative URL matches Regex formatting within the SCAYLE Panel.

  1. In the text field beneath the Regular Expression field, enter the URL you want to test.
  2. Click Validate Test String.
  3. If the formatting is correct, the field counter will show the number of successful matches. If the formatting is incorrect, the field will say the Regex format is invalid.

The validation only checks for matches between the regular expression and the test URL you provide, not the target URL.

A successful Regex formatting test

Export Redirects

Redirects can be exported to an XLSX file. This exported file can be useful for bulk editing/updating redirects using the Imports function.

  1. Go to Shops > Shop > Storefront > Redirects.
  2. Click the Export button on the upper right.

The file has rows of all redirects with columns application_id, redirect_id, source, target, and status code.

Export Redirects

Delete a Redirect

To delete individual redirects, use the delete icon. To delete multiple redirects at once, use the checkboxes to select the ones you want to delete and click Delete.

Delete multiple redirects

Delete multiple redirects

  1. In the SCAYLE Panel, go to Shops > Shop > Storefront > Redirects.
  2. Use the checkboxes to select the redirects you want to delete and click Delete.

Delete multiple Redirects.