Redirects
Create redirects with relative paths to ensure that none of your pages 404.
Overview
The redirect manager allows users to create and delete either 301 or 302 redirects, as well as to mass upload redirects without needing access to .htaccess
files. All of your current redirects are visible upon navigating to your instance's Redirects section.
You can navigate to the redirects in the left side navigation bar:
Redirects are especially helpful when you've changed the URL of a page or resource. When URLs are changed users might still have links to those old URLs. When accessed, those old URLs will be 404 if a redirect is not in place. When a redirect has been created the browser will automatically send the user to the new page (instead of terminating at the 404 page).
We resolve published pages prior to redirects to prevent a redirect from mistakenly overtaking actual published pages. Therefore be sure to unpublish items that you're making redirects for to ensure your redirects perform as expected.
301 and 302 redirects
Zesty.io allows for the creation of 301 or 302 redirects. Learn more about 301 redirects here and 302 redirects here.
Create a 301 or 302 redirects by following these steps:
1. Add a specific link in the left-hand "From" column. Do not include the domain. For example: /team-members
2. Choose whether you want a 301 or 302 redirect by toggling the switch between the columns.
3. Search for a link by typing the name of the page into the textbox. For example, if your page was called "About Us" then you'd stay by typing "about " and see what results are returned. Select the link that you'd like it to redirect to in the right-hand "To" column from the results.
4. Click the green "+ Redirect" button to create the redirect.
Note: When creating a new redirect, always start the old redirect with a forward slash,
/
, and include the entire path after the domain.
Redirects are case sensitive, so/old-path/
and/Old-Path/
would need to be separate entries.
Mass Redirect
To use our mass redirect tool you can import a CSV file or an XML file to create redirects.
CSV
To create redirects with a CSV you need to have all of your "From" URLs in one column, your "Target" URLs in another column, and optional Code (e.g. 301 or 302) and TargetType (e.g. path, page, external) columns.
Follow these steps to create a CSV of your redirects:
- Create a CSV with 4 columns
- Title your columns
- From
- Target
- Code (if not specified defaults to 301)
- TargetType (if not specified defaults to path)
- If TargetType is path then use relative path only. Do not include your domain.
- If TargetType is page then Target must be a ZUID.
See the image below for an example of how your CSV should be formatted.
Once your sheet is properly formatted click the gray "Import CSV/XML" button and import your sheet.
When importing content into a date field use the format: MM/DD/YYYY or MM/D/YY
XML Sitemap
To mass upload from XML, use the XML format required for sitemap.xml files provided to search engines. This format only reads old paths and requires selecting the new path to redirect to using the interface.
Redirect Formats
Type | Example: Old Path => New Path |
---|---|
Path | /this/ => /that/ |
Path (with wildcards) | /old/path/*/*/ => /new/$1/$2/path |
Page (zuid) | /old-about/ => 7-xyz-x1y2z3 |
External | /redirect-away/ => https://www.google.com |
All redirects will pass query parameters. For example:
/this/?hello=world
will becomes/that/?hello-world
Path Redirects
A basic path redirect is a statically typed path to another statically typed path. See below example.
// redirect:path
/old/path/
// redirect:target
/my/new/path/?a=1&b=2
Any request to /old/path/
will redirect to /my/new/path/?a=1&b=2
Path Redirects with Wildcards
A path redirect with wildcards is a statically typed path with an asterisk(s) which can catch any path and pass it forward into a new dynamically built path. See below example.
// redirect:path
/old/*/*/
// redirect:target
/new/$1/$2/
Example Redirect Results Table
Incoming Request Path | Redirect Path |
---|---|
/old/foo/bar/ | /new/foo/bar/ |
/old/apples/oranges/ | /new/apples/oranges/ |
Another path building example with Wildcard Paths
// redirect:path
/old/*/*/
// redirect:target
/$1-$2/
Example Results Table
Incoming Request Path | Redirect Path |
---|---|
/old/hello/world/ | /hello-world/ |
/old/foo/bar/ | /foo-bar/ |
Other ideas for redirects
Path Examples | Target Examples |
---|---|
/old/*/*/ | /search/?q=$2 |
/*/*/*/ | /$2-$1-$3/ |
Page Redirects
Page redirects take in a static string string for the path like /my/old/path
and a content ZUID as the target. The static path will always redirect to whatever the content ZUIDs current path is, even if the content ZUID referenced has its path change through version, the redirect will always follow it.
External Redirects
Page redirects take in a static string string for the path like /my/old/path
and a content ZUID as the target. The static path will always redirect to whatever the content ZUIDs current path is, even if the content ZUID referenced has its path change through version, the redirect will always follow it.
Redirects API Documentation
See how to create the above types of redirect from our REST documentation.
Create Redirect
Updated about 2 months ago