How to rewrite paths with AWS CloudFront #1819
Answered
by
kermanx
peacock0803sz
asked this question in
Q&A
-
Motivations
ProblemPutting bellow JavaScript for CloudFront Functions and associate to "Viewer request" (CloudFront > Distribution > Behaviors). function handler(event) {
const request = event.request;
const paths = event.request.uri.split("/");
// console.log(paths);
// console.log(request.uri);
if ((paths.length <= 2 && paths[1] !== "index.html") || (paths.length >= 3 && paths[2] !== "index.html")) {
request.uri = `/${paths[1]}/index.html`;
}
return request;
} Then it shows just a blank page (not slide contents) like this: CleanShot.2024-08-15.at.16.08.37.mp4Any knowledges / know-hows? Please let me know. |
Beta Was this translation helpful? Give feedback.
Answered by
kermanx
Aug 15, 2024
Replies: 1 comment 3 replies
-
Have you added the slidev build --base /some-talk/ |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that the urls like
/pyconapac2023/assets/*
should be preserved. Maybe it should be