Redirects

A redirect sends a visitor who opens one address straight to another. List one rule per line in a file named _redirects to move old pages, rename routes, or point a path at another site.

Applying redirects on a published site needs Lediv Pro. The file travels with your export on any plan, and hosts like Netlify and Cloudflare Pages read it natively.

Create the file

  1. In the Files panel, create a file at the project root and name it _redirects.
  2. Write one rule per line.
  3. Publish the site for the rules to take effect.

Only the file at the root is read, next to package.json. One inside pages/ or public/ is ignored.

Write a rule

Each rule is a line with two or three parts separated by spaces.

Blank lines are fine. A word that starts with # starts a comment, at the beginning of a line or after a rule. So /old /new # moved in May is a rule with a comment, while in /old /new#moved the #moved is part of the destination.

Match many paths at once

Names use letters, numbers and underscores, cannot repeat in /from, and cannot be splat. Every name in the destination has to come from /from. The wildcard has to be a segment of its own, as in /blog/*, so a glued prefix like /blog* is invalid. A line that breaks any of this is skipped, and the rest of the file keeps working. After publishing, the Publish panel lists the lines it skipped and any rules it discarded. Other hosts are looser about the glued form, so look for it first when you bring a file over from one of them.

Which rule wins

Rules are read top to bottom and the first match wins, so put the most specific ones first.

A redirect beats a page at the same path. If a rule matches /pricing, visitors are sent away even when your project has a /pricing page, and that page becomes unreachable. Check that /from is an address you no longer serve.

Example

# Send an old page to its new home
/old-page /new-page

# A temporary detour, so browsers do not cache it (302)
/webinar /webinar-2026 302

# Move an entire section, keeping the rest of the path
/blog/* /articles/:splat

# Match a single segment by name
/user/:id /profile/:id

# Point a route at an external site
/community https://forum.example.com

/legacy-contact /contact 301  # a comment can close a rule too

Good to know


Next steps