Closed manniL closed 5 years ago
Is this available already? I couldn't find any documentation.
@ericmarcos I don't think so.
It looks like they never finished episode 3 :(
It would be great if something like this would be possible:
/:dir/*.pdf /:dir/:splat 301!
I actually have a more involved use-case. It would look something like this
/dir/:pdf /api/tracker?pdf=:pdf
/dir/:pdf.pdf https://bucket.s3.amazonaws.com/dir/:pdf.pdf 200
The API would then redirect to the url with extension with a location header.
So basically, the redirects handle a proxy to the API in order to track the number of times the file was requested. I used to do this with Apache but I think if the tokens were a little more strict here it could work.
To the user, all it would look like is that the url is just adding the extension for the file.
I want to redirect from
/api/2018/04/13/openapi-and-json-schema-divergence-solved
to
/2018/openapi-and-json-schema-divergence-solved
but that doesnt seem possible with the * and splat...
/api/:year/:month/:day/:slug /:year/:slug
About me
My question in a little more detail
I really enjoy the
redirect
system and the idea of splats and placeholders. However, I feel like sometimes it'd be useful to have more freedoms to customize redirects.Especially I'm missing that we can't use regular expressions to match (and re-insert) URLs or query variables as you can with
Apache
,Nginx
or even other Netlify competitors.Will there be RegEx support for redirect rules in the future or would you suggest using a custom function instead? 🤔