Last updated: 13 July 2020
Where to find the Redirect Module in Sitecore
If you change the URL of a page (see below for moving a page) in Sitecore and publish it, all internal links within the site will be automatically updated. However, any page outside of the site that links to this page won't. You can create a redirect so that when people click on the old URL, they are automatically redirected to the updated URL.
If you want to create what's called a "short URL", one that is often used in print publications so that the link is easy for people to remember. This short URL can then link through to the full actual URL of the page. For example www.iamsterdam.com/redirect could link through to this page, which has a longer URL https://www.iamsterdam.com/en/cms-manual/repository/redirect-module.
How to create a Redirect
If you are setting up a short URL, Insert a new Redirect URL in the SHORT URLs folder under /sitecore/content/Repository/Redirect Module. Name the item (the name you see in the Sitecore tree) the same as the short URL you are creating. For example www.iamsterdam.com/redirect will be called "redirect" in Sitecore.
If you are setting up a redirect from an old URL to a new URL, place it in the folder of the current year under /sitecore/content/Repository/Redirect Module. It's currently 2020.
All redirects can be made in any language version of the widget, even if the page you're redirecting to is in another language. The fields are shared. Just be sure to publish your item in the language that you've created it in.
The info is added under the Information tab:
- Requested URL: this is the URL you want to redirect from. This can either be a short url - a short, easy to remember, URL for a page. Start the URL with a forward slash / and enter the short name for the URL. Multiple words should be linked with a hyphen. Ex: /expat-seminar
Or, enter here the original URL of a page that you've now renamed. The format should be like so: /cms-manual/repository/redirect-module (always start the string with a forward slash and do not include the language prefix) NOTE: You cannot create a redirect from an existing page that is live, even if the language you want to redirect is not live. Ex: www.iamsterdam.com/EN/example is live, but www.iamsterdam.com/NL/example does not exist. You cannot redirect www.iamsterdam.com/NL/example.
- Response code: 301.
- Redirect to item: select the new page from the Sitecore tree that the old link or the short URL should redirect to.
- Redirect language prefix: en, nl, fr, es, de, it (lowercase!) NOTE: having to select a language prefix implies that your redirect item can only be made for one language. For example, if you want to create a short url www.iamsterdam.com/24H, this short url can only redirect to one page, say the English 24H homepage. The short url cannot then also be used to link to the Dutch 24H homepage. You will have to choose another short url, for instance www.iamsterdam.com/24Hours.
Moving pages in Sitecore
If you move a page in Sitecore, a redirect will automatically be created. You will see this described in the yellow bar at the top of the page. It's advised to review the redirect definition and add the language redirect to the definition. This way you have both an internal and external redirect.