Open
Description
I have no idea how to remain querystring on the full url?
Here my now code
function handler(event) {
var request = event.request;
var uri = request.uri;
// Check whether the URI is end with .html
if (uri.includes(".html")) {
var newUri = uri.replace(".html", ""); // Delete .html from URI
var response = {
statusCode: 302,
statusDescription: "Found",
headers: { "location": { "value": newUri } }
};
return response; // Redirect user to new location without .html
}
return request; // Pass normal request to CloudFront
}
Let's say client request with
https://abc.xyz/index.html?region=ap-southeast-1
, So I want to redirect client to
https://abc.xyz/index?region=ap-southeast-1
but when I testing with real CloudFront Functions I got this result instead.
https://abc.xyz/index
This missing my query param. How to solve this?
Metadata
Metadata
Assignees
Labels
No labels