Redirect not working with random string in between

I tried with the below redirecting for the url https://opentelemetry-nodjs--patientnextgen.netlify.app/
the first two works and the last one is not working. Not sure whether I’m doing it correctly

Redirection working:

  ```
  /forums  https://orchard-alpha-primary-app.azurewebsites.net/forums  200
  /forums/*  https://orchard-alpha-primary-app.azurewebsites.net/forums/:splat  200
  ```

Redirection Not working

/pushed/*/p7.min.css https://test/:splat/p7.min.css 200

The url looks like this. The reason I’m trying with the * in the middle is the number after the res path will change always. So I need a url rewrite which works each time since we dont know the random number

https://test1/pushed/res/638314797085341666/p7/p7.min.css
https://test2/pushed/res/638320800675496601/p7/p7.min.css

@ram1 I don’t see any examples in the docs where the wildcard isn’t the last value.

If it’s not supported, you could try an Edge Function:

Is the wildcard rule apply for splat too.

Im trying to do like this
/p7/p7.min.css https://orchard-alpha-primary-app.azurewebsites.net/:splat/p7.min.css 200 but its not rewriting.

@ram1 It’s not something I ever tried, you can check the documentation yourself here:

@ram1 I just realized when answering another question that what you want is the documentation as Placeholders here:

As it says:

Splats
An asterisk indicates a splat that will match anything that follows it.

Placeholders
A placeholder either matches a path segment from one / to the next / or matches a final path segment including a file extension but excluding a query string.

So you should be able to do something along the lines of:

/pushed/res/:id/p7.min.css https://test/:id/p7.min.css 200
1 Like