3

I have this configuration for serve (serve.json):

{
  "headers": [
    {
      "source": "**/**",
      "headers": [
        {
          "key": "Content-Security-Policy",
          "value": "frame-ancestors 'none'"
        },
        {
          "key": "X-Frame-Options",
          "value": "deny"
        }
      ]
    }
  ],
  "rewrites": [
    { "source": "/**", "destination": "/index.html" },
    { "source": "/logout", "destination": "/logout.html" }
  ]
}

When running 'serve build' (build being the folder where the html files are served from) and trying to access localhost/logout, I'm redirected to index.html.

The desired behaviour is to use logout.html when accessing logout route.

It looks like "/**" takes priority as every time I'm redirected to index.html.

Thank you

Ionut Cirja
  • 107
  • 1
  • 8

1 Answers1

0

Though I hadn't yet confirmed it, have you considered reversing the order, so that the explicit rules (such as /logout) are earlier in the array than the implicit/wildcard rewrite rules (such as /**)?

James Perih
  • 1,360
  • 1
  • 17
  • 19