From c5dea1e1df07e90ffe4a9349e2631dfaf4ee2fdf Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 7 Nov 2021 14:53:56 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Move=20catch-all=20redirect=20af?= =?UTF-8?q?ter=20serverless=20funcs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The catch-all redirect is required for Vue's HTML5 history mode to work on Netlify. However the current configuration was redirecting everything, including the API endpoints to index.html, preventing the serverless functions (for status checking, config management, etc) from working. 🤞 Hopefully this will work... --- netlify.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/netlify.toml b/netlify.toml index d0b60897..37bf6217 100644 --- a/netlify.toml +++ b/netlify.toml @@ -16,12 +16,6 @@ STATUSKIT_SUPPORT_CONTACT_LINK = "https://github.com/lissy93/dashy" STATUSKIT_RESOURCES_LINK = "https://dashy.to/docs" -# For router history mode, ensure pages land on index -[[redirects]] - from = "/*" - to = "/index.html" - status = 200 - # Redirect the Node endpoints to serverless functions [[redirects]] from = "/status-check" @@ -33,6 +27,12 @@ to = "/.netlify/functions/not-supported" status = 301 force = true + +# For router history mode, ensure pages land on index +[[redirects]] + from = "/*" + to = "/index.html" + status = 200 # Set any security headers here [[headers]]