Set up site redirects to route traffic to content anywhere on your site
Site redirects are useful when migrating documentation or restructuring content to avoid broken links, which can impact SEO.
Redirects are commonly used when you are migrating your documentation from one provider to another — like when you just moved docs to GitBook. Broken links can impact SEO so we recommend setting up redirects where needed.
To get started, view your site’s dashboard in GitBook and click Settings in the top-right corner. Scroll down to the Redirects section.
Creating redirects
Click Add redirect to begin. Fill in the source path — i.e. the URL slug that you wish to redirect somewhere else — and the destination content you wish to link to. You can pick any section, variant, or page on to your site. Click Add to create the redirect.
If you want to add another redirect to the same page, you can toggle the Add another redirect option on before you hit Add. When you add your redirect, the modal will remain open with the destination content set to the previous selection so you can add another URL slug immediately.
Clicking Add redirect opens a modal with two fields — Source path and Destination content.
Editing redirects
To edit a redirect, press the Edit icon next to it in the list. Update the redirect and hit Save.
To delete a redirect, press the Delete redirect button and confirm.
Clicking the Edit icon next to a redirect opens a modal that lets you edit or delete the redirect.
About automatic redirects
Whenever pages are moved or renamed, their canonical URL changes with them. In order to keep your content accessible, GitBook automatically creates a HTTP 301 redirect from the old URL to the new one.
Every time a URL is loaded, GitBook resolves it through the following steps:
Site content is resolved to its canonical URL by following any of the automatically created redirects.
If the URL cannot be resolved, the URL is checked against space-level redirects, defined in your repository's .gitbook.yaml file.
Finally, the URL is checked against site-level redirects, created via the process above.