Learn why Gartner just named Builder a Cool Vendor

Announcing Visual Copilot - Figma to production in half the time

Builder.io logo
Contact Sales
Platform
Developers
Contact Sales

Blog

Home

Resources

Blog

Forum

Github

Login

Signup

×

Visual CMS

Drag-and-drop visual editor and headless CMS for any tech stack

Theme Studio for Shopify

Build and optimize your Shopify-hosted storefront, no coding required

Resources

Blog

Get StartedLogin

This tutorial covers creating a Data model to configure server-side redirects in Builder. A server-side redirect is a technique for rerouting site traffic from one web address to another. For example, if you create a Page and later want to reroute visitors to another Page that has a different URL, you'd set up a URL redirect.

Use cases for server-side redirects include:

  • Reroute traffic to an updated Page from an outdated one.
  • Phase out an old URL without breaking links to the old URL.
  • Redirect traffic when you're updating URL naming conventions.

Youʻll need an evergreen browser; that is, a modern, up-to-date browser such as Google Chrome.

  1. Go to Models.
  2. Click the + Create New button.
  3. Name and describe your model. This example uses the Name URL Redirects and the Description Manage URL redirects for site content.
  4. Add a custom field by clicking on the + New Field button. Name the first new field sourceUrl with a Type of Url.
  5. Repeat the previous step for a field called destinationUrl of Type Url and a third field called redirectToPermanent of Type Boolean.
  6. Click Save.

The following video goes through the above steps:

Tip: When you configure your codebase to use the redirect later in this tutorial, you'll need the name of the model you just created. The name, known as the Unique identifier in the Builder UI, in this example is url-redirects, which you can find by clicking the Show More button.

For a video pointing out the location of the name, refer to the Finding the model name section of Data Models.

The next step is to use the Data model you just made. Here you make a Data content entry to redirect a URL called /site/intro to /site/getting-started.

  1. Go to Content.
  2. Click the + New button.
  3. Select URL redirect.
  4. For the SourceUrl, enter /site/intro.
  5. For the DestinationUrl, enter /site/getting-started.
  6. Name the new content entry /site/intro -> /site/getting-started. This way, when the URL Redirects are listed in the content area of Builder, each redirect's purpose is in the name, so you don't have to open them to see the URLs that are being redirected.
  7. Click Save.

This video shows the process of making a server-side-redirect as outlined above:

To get even more out of Data models with Builder, check out Integrating CMS Data.

For more general information on Data models, refer to the Data Models documentation.

Was this article helpful?

Product

Visual CMS

Theme Studio for Shopify

Sign up

Login

Featured Integrations

React

Angular

Next.js

Gatsby

Get In Touch

Chat With Us

Twitter

Linkedin

Careers

© 2020 Builder.io, Inc.

Security

Privacy Policy

Terms of Service

Get the latest from Builder.io

By submitting, you agree to our Privacy Policy

Product

Platform Overview

Integrations

What's New

Open Source

Builder

Mitosis

AI Shell

Micro Agent

GPT Crawler

Qwik

Partytown

Popular Guides

From Design to Code Guide

Composable Commerce Guide

Headless CMS Guide

Headless Commerce Guide

Composable DXP Guide

Design to Code

Resources

Blog

Knowledge Base

Community Forum

Partners

Templates

Success Stories

Showcase

Resource Center

Frameworks

React

Next.js

Qwik

Gatsby

Angular

Vue

Svelte

Remix

Nuxt

Hydrogen

See All

© 2024 Builder.io, Inc.

Security

Privacy Policy

SaaS Terms

Security & Compliance

Cookie Preferences

Gartner Cool Vendor 2024