Note: While our most popular guides have been translated into Spanish, some guides are only available in English.
Creating URL redirects

You can create URL redirects to forward visitors away from pages that don't exist to active pages. This can be for a permanent change (301 redirect) or a temporary change (302 redirect).

This guide explains how to create redirects in the URL Mappings panel.

Watch a video

301 vs. 302 redirects

The basic difference between a 301 and 302 redirect is that a 301 redirect means a permanent change and a 302 redirect means a temporary one. 301 redirects are more common than 302 redirects.

301 redirects

301 redirects are permanent. They tell browsers to go to a different URL when someone clicks a link to a nonexistent page. They tell search engines that a page has moved, and search engines transfer the old page's Page Rank to the new page. To use a 301 redirect, the original URL can no longer exist.

Most likely, when creating a URL redirect, you'll use a 301.

302 redirects

302 redirects are temporary. They tell browsers to go to a different URL when someone clicks a link to the old page. They tell search engines that a page has temporarily moved. Search engines don't give the new page the same Page Rank as the old one. However, since this is temporary, it lets search engines know that the original page should keep its rankings, as it will be back online.

302 redirects are commonly used in eCommerce when a store or restaurant changes its products and offerings seasonally.

When should I use URL redirects?

Usually, you'll use a 301 redirect. Depending on your situation, a 302 redirect may be better. Here are the common scenarios where you'll need to create redirects.

Using 301 redirects

Since 301 redirects are for permanent changes (the page has moved permanently), 301 redirects are mostly used when a URL has changed. For example:

  • If you changed a page's URL (in its Page Settings)
  • If you deleted a page from your site and want to redirect to your homepage
  • If URLs are different after importing content. In this scenario, it's usually because your previous site didn't have a page slug for the blog page, just posts. Squarespace has a page slug for the Blog Page followed by the slug for the post.
  • If you're redirecting to another domain
Note: Ensure the old URL doesn't exist and that the new URL does. You can do this by deleting the old page, disabling it, or changing its URL. For more information on deleting pages, disabling page, and changing URLs, visit Adding pages to your navigationEnabling and disabling pages, and Changing URL slugs.

Using 302 redirects

Since 302 redirects are for temporary changes (the page has gone on vacation, and will be back soon), 302 redirects are uncommon and usually used by stores and restaurants whose offerings change seasonally. For example:

  • If you need to temporarily take down a page to update it for your new offerings
  • If you want to temporarily replace a page with another page as you cycle through different offerings through the year

The rest of this guide will walk you through setting up your redirects.

Before you begin

  • URL redirects only apply to the built-in and custom domains connected to your Squarespace site. If your domain is hosted by another provider, connect it to your site before using URL redirects.
  • Ensure you keep the same capitalization as your URLs. If your URLs are all lower cased, then your redirects should also be all lower cased.
  • Most URL redirects can't use ?, &, or # symbols, as these interfere with the redirect process. This may prevent you from linking to anchor links and some Index Pages. One exception is RSS feed URLs, which can contain the ? symbol.
  • Ensure that your URL redirects don't use any reserved URL slugs.
  • The URL mappings field has a limit of 400 KB, which is usually around 2500 redirect lines. We recommend deleting inactive redirects to keep this area manageable.
  • When a visitor activates a redirect more than once within two minutes, it sends them to a 404 page. This is a security precaution that helps prevent redirect loops.
  • Your site activates redirects from top to bottom, so higher redirects will take priority over conflicting redirects below them. If you have specific redirects (for example, an individual blog post), place them above broader redirects that may conflict (for example, the main Blog Page).
  • Redirects only work if the page you're redirecting from has been deleted or disabled.
  • If a page redirects to a deleted or disabled page, the a 404 page will display.

Step 1 - Go to Advanced Settings

From your Home menu, click Settings, click Advanced, and then click URL Mappings.

Step 2 - Create shortcuts

Redirect one page

To create a URL mapping, you need four elements:

  1. The old URL for the page that doesn't exist
  2. The "arrow", which is a dash immediately followed by a greater than sign (->)
  3. The new URL for the page you want to redirect to
  4. The redirect type (301 or 302)

The URL mapping looks like this:

/old-url -> /new-url 301

Redirect multiple blog posts, events, or products

These pages usually include multiple items:

  • Blog Pages (there are usually multiple blog posts in the page)
  • Product Pages (there are usually multiple products in the page)
  • Events Pages (there are usually multiple events in the page)

Each item has its own URL that includes the page's slug followed by the item's slug (for example, /blog/example-post).

If you change a page's URL slug in Page Settings, every item in the page will have a new URL. You'll probably want to direct visitors to the right place even if they use an outdated URL to open an item. Instead of adding separate redirect lines for every post, you can save time by adding one line that redirects all item URLs.

To do so, use the [name] variable when creating the redirect.

For example, your old Blog Page's URL was /blog. You changed it to /posts. You want to ensure visitors can still view "Example Post" through http://www.yourdomain.com/blog/example-post. To do so, you’ll enter [name] in the redirect:

That redirect looks like this:

/blog/[name] -> /posts/[name] 301

Step 3 - Save

After adding your redirects, click Save at the top of the panel.

RSS feed URLs

The best way to redirect an RSS feed for podcasts is in Page Settings.

If you're redirecting an RSS feed manually, follow the steps above, but remove the ? and everything after it from the original URL. If you leave the original URL as-is, it will result in a 404 error.

For example, if you're trying to redirect this:

/old-url?format=rss -> /new?format=rss 301

Change it to:

/old-url -> /new-url?format=rss 301

After you've set this up, you can visit the URL with the format /old-url?format=rss directly, and the redirect will work correctly.

Examples and common scenarios

This section reviews some common situations requiring URL redirects and walks through how to set up redirects for them.

301 Examples

Changed page URLs

Use a 301 redirect when you permanently change the URL of a page. For example, if you have a page with the URL https://mybusiness.com/about and you want to change it to https://mybusiness.com/team, follow these steps:

  1. In the Page Settings, change the URL Slug.
  2. In URL Mappings, create the redirect from /about to /team.

The redirect looks like this:

/about -> /team 301

Deleted pages

Use a 301 redirect when you delete pages from your site and want to prevent visitors from seeing a 404 error page. For example, if you delete a page with the URL https://mybusiness.com/history, you can redirect visitors from that page to your homepage. Since the homepage doesn’t have a visible URL slug, you can use a blank slug in your redirect.

The redirect looks like this:

/history -> / 301
Note: To prevent a deleted page from showing in Google search results, index (or re-index) your site using Google Search Console.

Imported content

Use a 301 redirect when you import content from a different host. For example, if your blog was hosted on a site with the URL structure https://mybusiness.com/post-title, and on Squarespace the same post has the URL structure https://mybusiness.com/blog/post-title.

Because the post names are the same but the URL structure is different, you can create a single redirect rule for all blog posts. The redirect looks like this:

/[name] -> /blog/[name] 301
Note: Check with your previous host to ensure you have the correct URL structure for the first part of the redirect. The structure may vary, but so long you don’t change any post titles after importing, a redirect like the one above will cover all imported blog posts.

Moved collection items

Use a 301 redirect if you move collection items, such as products or blog posts, from one page to another. For example, if you move products from a Products Page with the URL https://mybusiness.com/shop1 to another Products Page with the URL https://mybusiness.com/shop2. In that case, a product with the URL https://mybusiness.com/shop1/item would now be https://mybusiness.com/shop2/item.

To redirect one item, the redirect looks like this:

/shop1/item -> /shop2/item 301

If you move all the items on a page, the redirect looks like this:

/shop1/[name] -> /shop2/[name] 301

In the second example, the /shop1 page shouldn't be used for new products anymore because all product URLs will redirect to /shop2.

Other domains

Use a 301 redirect if you have a URL on your site that you want to lead to another domain. For example, if you had a page with the URL https://mybusiness.com/fundraiser that featured information about a fundraiser, but now you want the URL to link visitors directly to an external domain.

Follow these steps:

  1. In URL Mappings, create a redirect from /fundraiser to the external domain.
  2. Delete or disable the /fundraiser page in your site.

The redirect looks like this:

/fundraiser -> https://fundraiser.com/very-special-fundraiser 301
Note: Ensure the URL you're directing to begins with https://.

302 examples

Existing pages during updates

Use a 302 redirect when you don’t want a page visible while making updates. For example, if you have a Products Page for seasonal offerings and need to update it for the new season, you can use a 302 to redirect visitors to your main Products Page temporarily.

Follow these steps:

  1. In URL Mappings, create the redirect from /seasonal-offerings to /main-products-page.
  2. Disable /seasonal-offerings and make your updates.

The redirect looks like this:

/seasonal-offerings -> /main-products-page 302

When you’re done updating /seasonal-offerings, follow these steps:

  1. Enable /seasonal-offerings.
  2. In URL Mappings, delete the 302 redirect.

Temporary pages during updates

This is similar to the above example, except instead of redirecting to an existing page, you create a temporary holding page while you make updates. For example, you can create a Cover Page that says “New offerings coming soon!” for the redirect.

Follow these steps:

  1. Create your temporary holding page. Give it a URL slug like /coming-soon.
  2. In URL Mappings, create the redirect from /seasonal-offerings to /coming-soon.
  3. Disable the /seasonal-offerings page and make your updates.

The redirect looks like this:

/seasonal-offerings -> /coming-soon 302

When you’re done updating /seasonal-offerings, follow these steps:

  1. Enable /seasonal-offerings.
  2. In URL Mappings, delete the 302 redirect.
  3. Delete /coming-soon, or disable it if you plan to use it for future updates.

Rotating between pages

Use 302 redirects if you want some pages to periodically redirect to another. For example, if you have four Products Pages, one for each season's sales, with the following URLs:

  • https://mybusiness.com/spring-sales
  • https://mybusiness.com/summer-sales
  • https://mybusiness.com/fall-sales
  • https://mybusiness.com/winter-sales

Because only one of these pages would be live at any given time, you can use 302 redirects to prevent links breaking. If summer is ending and you want to start your fall sales, follow these steps:

  1. Enable /fall-sales.
  2. In URL Mappings, create three 302 redirects from /summer-sales, /spring-sales, and /winter-sales to /fall-sales.
  3. Disable /summer-sales. In this example, /spring-sales and /winter-sales would already be disabled.

The redirects look like this:

/summer-sales -> /fall-sales 302
/spring-sales -> /fall-sales 302
/winter-sales -> /fall-sales 302

When fall is over and your winter sales start, enable /winter-sales, update your 302 redirects, and disable /fall-sales:

/summer-sales -> /winter-sales 302
/spring-sales -> /winter-sales 302
/fall-sales -> /winter-sales 302

Error messages

If there's an error in your URL mapping, you'll see a red error message and won't be able to save your changes. Here's how to troubleshoot any error messages:

Invalid mapping: Not enough parts

This means that you're missing the -> or the redirect type.

Invalid mapping: Too many parts

This means you have more than the four parts of a redirect. Check that you only have:

  • The old URL
  • The arrow: dash and greater than sign with no space between the symbols
  • The new URL
  • The redirect type (301 or 302)

Ensure that nothing is duplicated.

Invalid mapping: Expected to find 301 or 302

This means that there's an error in your redirect type. Only 301 and 302 are accepted here.

Check that there are no extra digits or letters in the redirect type.

Was this article helpful?
111 out of 234 found this helpful