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
/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
@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:
One of the common use cases for Edge Functions is redirecting clients to a different URL path based on certain conditions defined programmatically. In addition to a
standard HTTP redirect, you can choose to return a redirect with a 200 status code, which means that the URL in the visitor’s address bar remains the same, while Netlify’s servers fetch the new location behind the scenes.
This is commonly called a rewrite and has been available via the rewrite method in the Netlify context object. W…
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:
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