Parris
Parris

Reputation: 18418

Routing rules in cloudfront

I have routing rule set up for my static site in S3; however, it seems that cloudfront doesn't abide by these same rules. It at the very least doesn't obey the index file rule.

Is there anyway to set up routing similar to s3 in cloudfront? Is there a more powerful routing solution?

Upvotes: 13

Views: 12623

Answers (1)

kungfoo
kungfoo

Reputation: 597

I had the same problem. I was pointing cloudfront to the S3 bucket as opposed to the static domain name. If you point directly to the S3 bucket, the routing rules are bypassed (which makes sense since your routing rules are set only on the static hosting). Create a custom origin to the static public S3 bucket website and you're good.

I direct you to this answer on ServerFault: Why S3 website redirect location is not followed by CloudFront?

Upvotes: 22

Related Questions