Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,17 @@
# JS dependencies must be listed in package.json
command = "npm run build"
publish = "dist/"

# Redirect rules
# Splat redirect from /docs/<lang>/ to /
# For example /docs/en/overview to /docs/overview
[[redirects]]
from = "/docs/:lang/:slug"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JimMadge, my question here is that if it's always redirecting lang/ then what happens when we have Spanish? We probably want url/esp/overview, etc Again, I may totally misunderstand the intention!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The redirects are processed from the top to the bottom, with the first matching rule applying.

So I think we could add a rule above this like

[[redirects]]
    from = "/docs/es/:slug"
    to = "/es/:slug"

and that should take precedence over the more generic rule.

to = "/docs/:slug"
status = 302
# Splat redirect from /docs/ to /
# Previously the site was severed at allcontributors.org/docs/
[[redirects]]
from = "/docs/*"
to = "/:splat"
status = 302