スキップしてコンテンツを表示

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回答
2
承認された回答

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

エキスパート
回答済み 1年前
エキスパート
レビュー済み 1年前
エキスパート
レビュー済み 1年前
  • 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...

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ