Redirect not working with random string in between

I tried with the below redirecting for the url
the first two works and the last one is not working. Not sure whether I’m doing it correctly

Redirection working:

  /forums  200
  /forums/*  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


@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 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:

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

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