Remove trailing slashes from AWS S3 stating webhosting site

0

I have generated my WordPress website as static html and deployed it to s3 bucket to serve as static website.

Here is my website endpoint: wwwalls.com

My SEO team wants that the page URLs must not contain trailing slashes, but I could not find any document online that could allow me to get rid of trailing slashes from the URL eg : https://wwwalls.com/demo leads to https://wwwalls.com/demo/

I tried using redirects but then it ends up in too many redirects.

[
    {
        "Condition": {
            "KeyPrefixEquals": "demo/"
        },
        "Redirect": {
            "ReplaceKeyPrefixWith": "demo"
        }
    }
]

Please advice !

已提问 2 年前1596 查看次数
1 回答
1

May you try this LambdaEdge function: LambdaEdgeRemoveTrailingSlash ?

It seems to solve your issue.

You may read more about LambdaEdge here too: https://aws.amazon.com/lambda/edge/

AWS
已回答 2 年前
profile pictureAWS
专家
已审核 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则