Ir para o conteúdo

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 Resposta
2
Resposta aceita

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

ESPECIALISTA
respondido há um ano
ESPECIALISTA
avaliado há um ano
ESPECIALISTA
avaliado há um ano
  • 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...

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Conteúdo relevante