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 !

preguntada hace 2 años1597 visualizaciones
1 Respuesta
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
respondido hace 2 años
profile pictureAWS
EXPERTO
revisado hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas