Livestream: Best practices for building with GenUI | 5/22

Announcing Visual Copilot - Figma to production in half the time

Builder logo
builder.io
Contact SalesGo to App

Livestream: Best practices for building with GenUI | 5/22

Announcing Visual Copilot - Figma to production in half the time

Builder logo
builder.io

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 explains how to set up server-side redirects using Builder's Data model.

Server-side redirects guide visitors from one URL to another before the page loads. Use redirects to phase out old URLs without breaking links or to transition to new naming conventions.

  • Redirects run on the server, so the intermediate URL does not display.
  • Each redirect maps a source URL to a destination URL and can optionally mark the redirect as permanent with a 301 HTTP status.
  • Manage redirects in Builder using a single Data model without code changes until deployment.
  • An app in the framework of your choice with the appropriate Builder SDK installed.
  • Integrate your app with a Data model. For details, see Integrate with structured Data.

Create a Data Model to define a structured container for your site's URL redirects.

To create a Data model:

  1. Go to Models.
  2. Click + Create Model.
  3. In the Name field, enter URL Redirects.
  4. In the Description field, enter server-side redirects.
  5. Click Create.

The video below demonstrates creating a new Data model called URL Redirects:

Add custom fields to the model to store the redirect URLs and other settings for managing redirects in your content entries.

To add custom fields:

  1. On the Fields tab, click + New Field.
  2. In the Name field, enter SourceUrl and set the Type to Url.
  3. Repeat the process to create DestinationUrl with type Url and RedirectToPermanent with type Boolean.
  4. Click Save.

The video below demonstrates adding custom fields such as SourceUrl, DestinationUrl, and RedirectToPermanent to the Data model.

To create URL Redirects entries:

  1. Go to Content and click + New Entry.
  2. Select URL Redirect as the model type.
  3. In the Name field, enter /site/intro → /site/get-started to make the entry easy to identify.
  4. Assign values to each custom field: SourceUrl, DestinationUrl, and RedirectToPermanent.
  5. Click Save.

The following video demonstrates creating a content entry using the URL Redirects model and setting values for the custom fields.

In entry.server.tsx, import findRedirectByRequestUrl() and add the redirect logic at the top of the handleRequest() function.

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

  • Platform Overview

    AI Overview

  • Integrations

  • What's New

  • Figma to Code Guide

  • Composable Commerce Guide

  • Headless CMS Guide

  • Headless Commerce Guide

  • Composable DXP Guide

  • Design to Code

  • Blog

  • Knowledge Base

  • Community Forum

  • Partners

  • Templates

  • Success Stories

  • Showcase

  • Resource Center

    Glossary

© 2025 Builder.io, Inc.

Security

Privacy Policy

SaaS Terms

Compliance

Cookie Preferences

Gartner Cool Vendor 2024