As example that type of route is redirecting but without query strings.
XDN v2.30.1
.match('/some-prefix/:splat*', ({ redirect }) => {
redirect('/:splat*', 301)
})
As example that type of route is redirecting but without query strings.
XDN v2.30.1
.match('/some-prefix/:splat*', ({ redirect }) => {
redirect('/:splat*', 301)
})
you can access query string parameters via headers. they are stored in x-xdn-original-qs
header
You could also use compute
to construct your redirect URL based on the original request properties:
.match('/foo/:splat*', ({ redirect, compute }) => {
compute((request) => {
const query = request.url.split('?')[1];
redirect(`/bar/:splat*${query ? `?${query}` : ''}`, 301)
})
})
I could not find where the above suggested header was exposed.
It’s a known issue that the query string is not preserved by redirect
. We have a fix for this pending review which should be out soon.
Internal ticket has been created to track the effort on this. Updates will be posted as soon as possible
Ticket #: XDN-7901