Friday, August 5, 2022
HomeWordPress DevelopmentUse Route53 + S3 to ahead your area to absolute URLs.

Use Route53 + S3 to ahead your area to absolute URLs.


Suppose that you’ve got a website identify that you just need to ahead to an absolute URL. For instance, you will have a website identify dev.codewithyou.com and also you need to ahead it to https://www.codewithyou.com/weblog/cloudfront-restrict-user-access-by-signed-urls. You are able to do this with Route53 and S3.



Tips on how to do it



Step 1: Create a bucket and redirect it to an absolute URL

  1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/.
  2. Beneath Buckets, create a brand new bucket with the identify dev.codewithyou.com. Title of the bucket MUST is the identify of the area. If the identify is completely different, you’ll not see the bucket within the route53 alias report.
  3. Select the bucket that you just created in step 2 and click on on the Properties tab.
  4. Beneath Static web site internet hosting, select Edit.
  5. Select Redirect requests for an object.
  6. Within the Host identify field, enter www.codewithyou.com/weblog/cloudfront-restrict-user-access-by-signed-urls. This is absolutely the URL that you just need to ahead to your area. You should utilize any area identify you need. The URL should not embrace the protocol (http:// or https://).
  7. For Protocol, select none

Edit static website hosting

  1. Select Save modifications.

You’ll be able to take a look at the redirect by visiting the bucket url in your browser. For instance, http://dev.codewithyou.com.s3-website-ap-southeast-1.amazonaws.com/. It’s best to see it redirect to the https://www.codewithyou.com/weblog/cloudfront-restrict-user-access-by-signed-urls URL.



Step 2: Create a Route53 alias report

Now you should create a Route53 alias report. You are able to do this by going to the Route53 console at https://us-east-1.console.aws.amazon.com/route53/v2/dwelling#Dashboard

  1. Click on on the Create report button.
  2. Specify the next values:
    1. Report identify dev
    2. Report kind A Select A – IPv4 deal with.
    3. Alias. Choose Sure. Select the bucket that you just created in step 1.

Create alias record

Click on on the Create information button and await the report to be created.

After the report is created, you’ll be able to take a look at the redirect by visiting the alias report url in your browser. For instance, http://dev.codewithyou.com/. It’s best to see it redirect to the https://www.codewithyou.com/weblog/cloudfront-restrict-user-access-by-signed-urls URL.



Conclusion

It is a easy instance of how you can use Route53 and S3 to ahead your area to absolute URLs.
You too can do many different issues with Route53 and S3.

  • Redirect requests to your bucket’s web site endpoint to a different bucket or area
  • Configure redirection guidelines to make use of superior conditional redirects
  • Redirect requests for an object

I’ll proceed so as to add extra examples sooner or later. Thanks for studying!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments