In short. Netlify normalizes paths before redirect matching, so Pretty URLs and the deployed file structure determine slash behavior.
Definition: A trailing-slash redirect rule can fail because Netlify normalizes the request path at CDN edge nodes before redirect rules are evaluated. The redirect matcher therefore treats a path with a trailing slash and the same path without one as equivalent, while the separate Pretty URLs feature controls several slash and
.htmlbehaviors.
Key facts
- Netlify's redirect options documentation says edge nodes normalize URLs before redirect rules run.
- The normalized matcher treats paths with and without a trailing slash as equivalent, so the two
/blog/title-with-a-typopatterns in Netlify's example are effectively the same rule. - A rule from
/blog/remove-my-slashes/to/blog/remove-my-slashescan cause an infinite redirect because Netlify treats both paths as the same. - Netlify documents Pretty URLs as enabled by default for sites. With the feature enabled,
/aboutis forwarded to/about/and/about.htmlis rewritten to/about/. - The setting is checked at
Project configuration > Developer settings > Post processing > Pretty URLs.
What happens before a redirect rule matches?
Netlify's CDN edge nodes perform URL normalization before the redirect engine evaluates a rule. A rule with a slash in its source therefore matches the corresponding path without a slash, and a rule without a slash matches the corresponding path with one. The two source patterns below are equivalent under this documented behavior.
# These rules are effectively the same:
# either rule alone would trigger on both paths
/blog/title-with-a-typo /blog/typo-free-title
/blog/title-with-a-typo/ /blog/typo-free-title
The same documentation gives a slash-removal rule as an infinite redirect case. The ! forces the redirect, but it cannot create a distinct normalized source path:
# This rule will cause an infinite redirect
# because the paths are effectively the same
/blog/remove-my-slashes/ /blog/remove-my-slashes 301!
Netlify describes a proxy exception: normalization removes the trailing slash for ordinary requests but is not necessarily applied to internal rewrites. Its example rewrites /old-path to https://siteb.netlify.app/new-path with status 200.
What does Pretty URLs change?
Pretty URLs is a separate Netlify feature that can change the URL behavior produced by the deployed file structure. Netlify's support guide on trailing-slash behavior documents a static site with /blog.html: /blog/ redirects with HTTP 301 to /blog, while /blog serves the path. When the site contains /blog/index.html and no /blog.html, /blog.html and /blog each redirect with HTTP 301 to /blog/, while /blog/ serves the path.
With Pretty URLs enabled, the support guide says /blog.html redirects with HTTP 301 to /blog, and references to blog.html in HTML anchors are rewritten to /blog. With Pretty URLs turned off, the guide says Netlify resolves content across /blog.html and /blog, which creates two URL forms for the same content and can create duplicate content.
The redirect-options documentation states that a redirect rule cannot add or remove a trailing slash, then points to Pretty URLs for this URL standardization. The setting can be inspected at Project configuration > Developer settings > Post processing > Pretty URLs.
How should a rule be checked?
Netlify supports a plain-text _redirects file in the site's publish directory and redirect tables in netlify.toml. The redirects overview states that rules in _redirects are processed before rules in the Netlify configuration file. Within the redirect engine, rules are processed from top to bottom and the first matching rule is used.
For a slash issue, the relevant check is therefore the deployed path and the Pretty URLs setting, followed by the rule's position and force option. The redirects overview defines from as the case-sensitive path to redirect, to as the destination, status as the HTTP status code with 301 as the default, and force as the option that overrides existing content. None of those rule options changes the edge normalization described above.
Related terms
- How do I add redirects with Netlify's _redirects file?
- How do I make a Netlify redirect override an existing file?
- Which Netlify redirect wins when file and configuration rules overlap?
FAQ
Can a 301! rule force Netlify to remove the slash?
No. The documented example uses 301! and still loops because the two paths are equivalent after edge normalization.
Where do you check Pretty URLs?
Open Project configuration, then Developer settings, Post processing, and Pretty URLs. Netlify documents this path for checking whether the feature is enabled.
Why can a proxy behave differently?
Netlify documents that ordinary URL normalization removes a trailing slash, while internal rewrites do not necessarily receive that normalization. A proxied destination can therefore produce behavior that differs from a static file path.
Sources
- Netlify Docs, "Redirect options", 17 September 2026
- Netlify Support Forums, "[Support Guide] How can I alter trailing slash behaviour in my URLs? Will enabling Pretty URLs help?", July 2025
- Netlify Docs, "Redirects and rewrites", 17 September 2026
Check how a page reads to answer engines. Open the GEO score analyzer