Use 301 redirects to route traffic from an old to a new URL.
In this lesson:
301 redirects are useful if you need to permanently route traffic from an old path to a new URL. There are several use cases:
There are other types of redirects, such as 302 redirect which can indicate a temporary relocation, but 301 redirects are best used if you need to permanently route incoming traffic to a new URL.
When an old URL is replaced with a new URL, your old URL may still show up in the search results, it may be referenced in a blog post or a forum post, or it may be bookmarked, printed on business cards, or other materials. Anyone who visits the old URL will be led to a 404 page. When there is a 301 redirect set up, users clicking the old URL will be redirected to the specified new URL.
Google will eventually index your new site structure and old URLs will get updated. However, 301 redirects are a best practice, especially if you want to maintain ranking power from the old URL.
Permanently redirect old pages or entire folders of pages to new locations in your Webflow site using the 301 Redirects settings:
To redirect an entire folder
You can add multiple capture groups to create more complex redirect rules. For example: /blogs/(.*)/(.*) can be redirected to /articles/%1/%2
Let's say you want to redirect 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:
In the example above, "%1" refers to the first capture group, and "%2" refers to the second. With this wildcard redirect in place:
When using URLs with wildcards and single paths, escape the following characters by using the "%" symbol before the character:
For example, /old-folder/(.*) will need to be /old%-folder/(.*) in order to work.
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:
In this case, the "%" signs before the "?" and "=" are required to make the redirect work properly.
To redirect a domain to another one:
Something went wrong while submitting the form. Please contact email@example.com