Saltar al contenido

How do I fix this 403 when redirecting www traffic to non-www?

0

I have an S3 website with route-53 and cloudfront. I'm really happy with it.

I've edited the default cloudfront behaviour to redirect http to https and has a function on Viewer Request that rewrites - this looks fine when testing it in the web UI.

however, whenever I go to www. in a browser I get a 403 (either http or https)

It's doing my head in!

1 Respuesta
2
Respuesta aceptada

Hello.

Are you configuring domains with and without "www" in the settings in the CloudFront document below?
I think that if this was not set, an error would occur when accessing with a domain without "www".
Try verifying that the alternate domain is configured successfully.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CreatingCNAME.html
https://repost.aws/knowledge-center/cloudfront-troubleshoot-403-errors

EXPERTO
respondido hace un año
EXPERTO
revisado hace un año
EXPERTO
revisado hace un año
  • Oh my goodness Riku that was it! You are officially better than the AI that was helping me :) although it did give some other good advice...

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.