Redirects

Use redirects to redirect pages to another, internal or external, page.

Adding a redirect

Redirects consist of 3 parts, the page that is being redirected, the page to which the redirect should go and wether or not the redirect is permanent. A redirect could look like this:

/discounts -> /discounts/january-2017 302

  • Green is the page that is being redirect, this is the path that comes after the domain name. For example, if you want to redirect eresults.nl/summer, this would be /summer.
  • Blue is the page to which the redirect should go. This can be a path to another page on your website (in the same format as green), or a full URL to another website (eg. https://eresults.nl/random-page).
  • Purple indicates wether or not the redirect is permanent, you have two options here:
    • 301 Will indicate that this is a permanent redirect, search engines will remove the page you're redirecting from and replace it with the page you are redirecting to (the second part only applies when you're referring to a page on your own website).
    • 302 This is a temporary redirect. You can use this to redirect a page to the latest edition of your weekly blog or to point to the latest campaign page.

Is my redirect set up properly?

You can test a redirect by visiting the page you're redirecting from in your browser, if you see the new page everything your redirect is set up properly. Should you get any other result, here's a list of things that might be going wrong:

  • The redirect syntax isn't correct
    When the syntax for a redirect is correct, it'll be shown in color, like this: 
    /discounts -> /discounts/january-2017301

    Is the redirect not colored, but black, that means you have an error in your syntax. Make sure a redirect to a page on your own website starts with a forward slash (/), the from and to parts are separated with an arrow (->) and your redirect ends with a 301 or 302 code.
  • A page already exists on your from path
    To prevent pages from becoming unavailable because of redirects, pages will always be given priority. So if you're redirecting from a path on which a page already exists, the redirect will not work.

    You can solve this by making the page private (from the page's settings), changing the URL of the page, or removing the page if it is no longer required.
  • You are trying to redirect from a reserved path
    It is rare, but it could be the path you're trying to redirect from has been reserved for use by FifthGear. In this case it is not possible to create a redirect. Examples of reserved paths are:
    • /robots.txt
    • Paths starting with /admin, /login, /unity or /-fg
    • Paths that are in use in an integration

Redirects with variables

Sometimes you want to redirect multiple, similar, paths. That is where variables come in. With variables we can mark a section of the path as being variable, to make it match multiple paths. Here is how you use variables:

/news/[message] -> /blog/[message] 301

New is that we've placed a piece of the path between straight brackets, this is the named variable. Here we used a variable named message to redirect all pages below /news to a path with the same name under /blog. Eg. /news/press would become /blog/press.

The name of the variable is something you can decide, so pick something you think is easy to understand. Variable names can only use letters and numbers, so no spaces and other punctuation. You can use multiple variables if needed.

Do you want to redirect multiple pages to the same page, then you can leave out the variable on the to path, like this:

/service/[service] -> /all-services 301

Real world examples

Here are some practical real world examples you can easily copy for your own redirects.

Simple redirect

/discounts -> /discounts/january-2017301
A simple redirect from a to b, just make sure you don't have an active page with the same from path.

Redirect to another website

/partner-a -> https://partner-a.com 301
Redirect a page on your website to another website.

Redirect multiple pages in one rule

/news/[message] -> /blog/[message] 301
Redirect all pages under /news to /blog. A use case could be when you've renamed a page and want to redirect all subpages to their new path. Make sure the variable name is the same on both sides.

Redirect multiple pages to the same page

/employee/[employee] -> /employees 301
Redirect all pages under /employee to the /employees page. Use this when you've replaced multiple pages by a single overview.