Setting up 301 redirects

You can preserve your SEO rankings by redirecting old pages or entire folders of pages to new locations in your Webflow site using our 301 Redirect feature. Learn more about 301 redirects.

Redirecting a single page

  1. Go to project settings → hosting → 301 Redirects
  2. Add the old URL in the Old Path Field (/old-url)
  3. Add new URL in the Redirect to Page field (/entirely/new-url/structure)
  4. Click Add Redirect Path
  5. Publish your site
  6. Test the redirect by entering the old URL in a new browser tab

Redirecting an entire folder of pages using wildcards

  1. Open Project Settings
  2. Go to Hosting tab
  3. Scroll down to 301 Redirects section
  4. Add capture group from old URL structure in the Old Path Field (/oldfolder/(.*))
  5. Add target path for new URL structure in the Redirect to Page field (/entirely/new-url/structure/%1)
  6. Click Add Redirect Path
  7. Publish your site
  8. Test the redirect by entering any old URL in a new browser tab

You can add multiple capture groups to create more complex redirect rules. For example: /blogs/(.*)/(.*) can be redirected to /articles/%1-%2

You'll need to "escape" special characters with the "%" symbol. For example, /old-folder/(.*) will need to be /old%-folder/(.*) in order to work. 

The following characters need to be escaped: % - & * ( ) = _ + ?

Contact us if you are having trouble with multiple capture groups, we're happy to help!

Examples

1) Escaping special characters:

Let's say you want to redirect mysite.com/blog.php?category=music to mysite.com/blog/music

You'll need to write your redirect as follows:

  • old path: /blog.php%?category%=music
  • Redirect to page: blog/music

In this case, the "%" signs before the "?" and "=" are required to make the redirect work properly. This also applies for the following special characters: % & * ( ) = _ + ?

2) Wildcard redirects for groups or folders

Let's say you want all pages with the following URL structure /blog.php?category=music&post=beyonce to /blog/music/beyonce. You might have categories like "music", "travel", and "food" and posts like "beyonce", "hawaii", and"pizza". So, these are your variables. In the URL above, "music" and "beyonce" are the variables. 

To make these variable changes, you'll need to call out these variables with capture groups, which look like "(.*)". For example, you'd need to write this redirect as follows:

  • old path: /blog.php%?category%=(.*)%&post%=(.*)
  • Redirect to page: /blog/%1/%2

In the example above, "%1" refers to the first capture group, and "%2" refers to the second. With this wildcard redirect in place:

  • /blog.php?category=music&post=beyonce will redirect to /blog/music/beyonce
  • /blog.php?category=travel&post=hawaii will redirect to /blog/travel/hawaii
  • /blog.php?category=food&post=pizza will redirect to /blog/food/pizza