[[redirects]]
status = 200
from = "/*"
to = "/de/index.html"
But this does not kick in as soon as I add a language condition:
# Auto-redirects by language
[[redirects]]
from = "/*"
to = "/de/index.html"
status = 200
# Redirect based on browser language
conditions = {Language = ["de"]}
When I look for my browser settings in JS I get this:
Hi, @Jan, and welcome to our Netlify community site. Would you please send us a link to the site at Netlify or the API ID for the site?
The API ID (the ID not the key) is safe to share publicly if you don’t want to share the subdomain. The API ID is found under “Site Name” > Settings > General > Site information.
[build]
# Directory (relative to root of your repo) that contains the deploy-ready
# HTML files and assets generated by the build. If a base directory has
# been specified, include it in the publish directory path.
publish = "build"
# Default build command.
command = "npm run build-i18n"
# SPA support for german locale
[[redirects]]
from = "/de/*"
to = "/de/index.html"
# SPA support for english locale
[[redirects]]
from = "/en/*"
to = "/en/index.html"
# Auto-redirects by language for German
[[redirects]]
from = "/*"
to = "/de/index.html"
force = true
# The default HTTP status code is 301, but you can define a different one.
status = 200
# Redirect based on browser language, geolocation, and/or identity role.
conditions = {Language = ["de"]}
# Redirect rule for English
[[redirects]]
from = "/*"
to = "/en/index.html"
force = true
# The default HTTP status code is 301, but you can define a different one.
status = 200
# Redirect based on browser language, geolocation, and/or identity role.
conditions = {Language = ["en"]}
# Redirect rule for English
[[redirects]]
from = "/*"
to = "/en/index.html"
force = true
# The default HTTP status code is 301, but you can define a different one.
status = 200
# Redirect based on browser language, geolocation, and/or identity role.
conditions = {Language = ["en-US"]}
# Default language is english
# [[redirects]]
# status = 200
# from = "/*"
# to = "/en/index.html"
Yup, unfortunately it does map to the problem that @ndalliard linked (thanks for that!). We’ve linked this thread to that bug report too, so we can let you know when things change. The team is actively working on an overhaul of our redirects system that will fix many issues likely including this one, and hoping to launch in the next couple of months.
That doesn’t really help you today, but it is on our roadmap and we do intend to fix it (which is not something we’ll lie about if we don’t have firm plans).