How do I redirect a URL directory on Netlify?

The Citead team, updated

In short. A Netlify directory redirect uses * in the source path and :splat in the destination to preserve the remaining path.

Definition: As of October 2026, Netlify documents directory redirects using * to capture the remaining URL path and :splat to insert that captured text into the destination path.

Key facts

Where does the directory rule go?

Netlify's configuration overview requires each _redirects rule on its own line, with the original path followed by the destination. The publish directory is the folder of finished files deployed after the build. The _redirects file must reach that folder, including when a site generator produces the deployment files.

The documented directory example, with an explicit permanent redirect status, is:

/news/*  /blog/:splat  301

The equivalent netlify.toml configuration uses from, to and status:

[[redirects]]
from = "/news/*"
to = "/blog/:splat"
status = 301

The same overview states that paths are case-sensitive and special characters require URL encoding. It also documents 301 as the default status when the setting is omitted.

How does destination substitution work?

Netlify's splat and placeholder documentation gives this result: /news/2004/01/10/my-story redirects to /blog/2004/01/10/my-story. The captured suffix includes the nested directories.

A named placeholder matches a single path segment, including a final segment with a file extension and excluding the query string. Named placeholders can rearrange segments:

/news/:month/:date/:year/:slug  /blog/:year/:month/:date/:slug

The same documentation limits * to the end of the path: /jobs/* is supported; /jobs/*.html is unsupported.

How are exceptions ordered?

Netlify's rule processing documentation states that the first matching rule wins, reading from top to bottom. Rules in _redirects are processed before rules in netlify.toml.

The redirect options example puts a specific job URL before the directory rule:

/jobs/customer-ninja-rockstar  /careers/support-engineer
/jobs/*                      /careers/:splat

A separate exception placed below the splat would already match the broader rule. Netlify recommends earlier specific rules for exceptions because splat rules have no exclusion syntax.

FAQ

Why does an existing file still load?

Netlify's force redirect documentation explains that a matching file can prevent a redirect. You can override that behavior with 301! in _redirects or force = true in netlify.toml.

Should I use status 200 for a permanent directory move?

Netlify's rewrite documentation says 200 keeps the browser URL unchanged. For a permanent move, you can use the 301 status shown in the directory examples above.

Sources

  1. Netlify, "Redirect options", 17 September 2026
  2. Netlify, "Redirects and rewrites", 14 July 2025
  3. Netlify, "Rewrites and proxies", 14 July 2025

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark