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
Insert a new Redirect URL in the main tree under /sitecore/content/Repository/Redirect Module. All redirects can be made in the English version of the widget, even if the page you're redirecting to is in another language. This is explained below.
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.
- Response code: 301 if the page URL has been changed/moved permanently, or 302 if temporarily, like a short url name.
- Redirect to item: select the new page from the Sitecore tree that the old link should redirect to.
- Redirect language prefix: en, nl, fr, es, de, it. 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.