Redirects

A redirect sends a visitor who opens one address straight to another. Add a file named _redirects to your project and list one rule per line 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.

Keep it at the root, next to package.json, not inside pages/ or public/. Only the root file is read.

Write a rule

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

Blank lines are fine, and # starts a comment at the beginning of a line or at the end of a rule. It has to be its own word, so /old /new # moved in May is a rule with a comment while /old /new#moved is not.

Match many paths at once

Names are letters, numbers and underscores, cannot repeat in /from, and every name in the destination has to come from /from. A line that breaks any of this is skipped, and the rest of the file keeps working.

The wildcard has to be a segment of its own, as in /blog/*. A glued prefix like /blog* is not valid here and the line is skipped. Other hosts are looser about it, so look for that form 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