Skip to content

Redirecting URLs

Learn how to redirect URLs for pages and page headings on Braze Docs. For general information about URLs, see About content management.

Page URLs always match the directory structure of the Braze Docs repository. When a Markdown file is renamed or moved to a different directory, the original URL will result in a 404 error if a redirect isn’t set up.

Example of a 404 page on Braze Docs.

By setting up URL redirects, you’ll help prevent user bookmarks from breaking.

Prerequisites

If you haven’t already, complete the steps for Contributing to Braze Docs.

Redirecting a page

You can choose to redirect a page’s URL to the Braze Docs home page or a new location.

Open the relevant Markdown file and add the following key-value pair to the YAML front matter. If there’s already a layout key, replace the existing key with the new one.

Your YAML front matter should be similar to the following:

Move or rename the relevant Markdown file, then navigate to the assets/js/ directory and open the global redirect file.

At the of the file, create a redirect on a new line using the following syntax:

Replace the following:

Placeholder Description
REDIRECT_FROM The URL you want to redirect from with https://www.braze.com/ removed from the URL string.
REDIRECT_TO The URL you want to redirect to with https://www.braze.com/ removed from the URL string.

Your redirect should be similar to the following:

Redirecting a heading

To redirect the URL for an in-page heading, you’ll use the local_redirect key within the page’s YAML front matter. First, move or rename the relevant Markdown file, the use the following syntax in the page’s YAML front matter:

Replace the following:

Placeholder Description
OLD_HEADING The old heading in Markdown syntax with the # removed.
NEW_HEADING_URL The new heading URL you want to redirect to with https://www.braze.com/ removed from the URL string.

Your redirect should be similar to the following:

Testing redirects

You can use bdocs to lists all of the old URLs you set up using a base URL of your choice.

The following example uses the Sage AI rebrand PR .

Troubleshooting

If a redirect you set up in the global redirect file (assets/js/broken_redirect_list.js) isn’t working, double-check your URL string for any uppercase characters. If you find any, convert them to lowercase (even if the corresponding filename in the _docs directory contains uppercase characters).

HOW HELPFUL WAS THIS PAGE?
New Stuff!