Is it possible to use Route 53 to point a path url like mydomain.com/app
to a different s3 bucket than the one accessed by the rest of mydomain.com
?
So for example:
mydomain.com/*
would point to normal-bucket
mydomain.com/app
would point to app-bucket
Is it necessary instead to just use a subdomain like app.mydomain.com
?
Would a routing rule make this possible?
You can create an Amazon CloudFront distribution, then defining an origin for each of your Amazon S3 buckets. You can then define which path should use which origin.
See the (confusing) documentation page: Values that You Specify When You Create or Update a Web Distribution
This is possible, but not with route53 or DNS generally.
If you are using S3 static website hosting, you can use a redirect rule instead, to do HTTP redirects. See Amazon documentation for more information about that feature: https://docs.aws.amazon.com/AmazonS3/latest/dev/HowDoIWebsiteConfiguration.html
Here is an example of a routing rule that redirects to my-other-bucket on S3, where both the bucket with the rule and my-other-bucket are using static website hosting.
<RoutingRules>
<RoutingRule>
<Condition>
<KeyPrefixEquals>app</KeyPrefixEquals>
</Condition>
<Redirect>
<HostName>my-other-bucket.s3-website-us-west-2.amazonaws.com</HostName>
</Redirect>
</RoutingRule>
</RoutingRules>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With