Use 301 redirects to route traffic from an old to a new URL.
301s can change your life forever — if you’re setting up a new webpage or even a full website — especially if you have a different structure.
Maybe you’ve reorganized, or maybe you’re replacing the full site and it’s not practical to use the same URLs, or maybe you’ve moved domains completely — or locked up “typo” domains to make sure accidental misspellings and keystrokes still end up taking users to the right place.
301s are meant to more permanently route traffic to a new location. Not to be confused with 302s which can indicate a temporary relocation of a resource, or 511s™, which are a more modern, slim fit. Again, 301s are best used when you’re permanently routing incoming traffic to a newURL.
And there are three main considerations to make — three different areas to look at when we’re considering whether to use one or more 301 redirects for a website.
The first is Google, and really all modern search engines.
Let’s say we’re searching for your webpage, but you’ve recently replaced your old URL with a new one.
If you’ve changed this URL and you don’t have a redirect — a 301 set up — people who click that link are going to see a 404. Not a great user experience.
Instead, if we’ve set up a 301 redirect, when someone clicks that old link to the old URL, your server will automatically detect that attempt and route people to the new URL you specified. This is great because it gets everyone to the right spot. And it can indicate to Google that the page’s URL has changed.
Even without redirects, Google will eventually index your new site structure and these URLs will get updated. But 301 redirects are absolutely the best practice, especially if you’re looking to maintain a lot of the ranking power that the older URL had.
The second consideration to make is referral sources all over the internet. Maybe someone included the old path in a blog post or a forum. 301s — when we create them for these older links — will ensure that visitors clicking that link can get to the right path — the new URL — without any trouble.
And the third consideration is usage of that older path in URLs that people might have bookmarked—or URLs that they might type directly into their browser. Maybe business cards or other materials were printed or published using your old URL. A 301 is a really great way to go if you want to make sure that anyone who types in the older URL gets to the right place.
So. The concepts associated with these three considerations all involve the same thing: old URLs getting routed to new ones. 301 redirects are a great move whenever you’re making changes to an existing site’s paths or URL structure—or in any circumstances where you want to more permanently route traffic from one location to another.
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 support@webflow.com