Configuring Redirects for a Static Website Hosted on Amazon S3

Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Redirecting Static Website Traffic to Another Amazon S3 Bucket
lock
Handling Error Routing with Conditional Redirects

Ready for the real environment experience?

DifficultyIntermediate
Time Limit1h
Students10
Ratings
5/5
starstarstarstarstar

Description

A static website that is hosted on an Amazon S3 bucket uses client-side technologies such as HTML, CSS, and JavaScript in order to render static content to users. To access the static website, users can navigate to a custom domain that they've registered and configured using Amazon Route 53 or Amazon CloudFront, or by simply visiting the S3 bucket URL.

As the website continues to develop, it's important to provide a seamless transition for users as new designs and features come available. URL Redirection (or URL Forwarding) is a technique that allows you to redirect requests to a different URL. Your website and its users can benefit from redirects in the following instances:

  • Rendering content that is stored in multiple locations
  • Overriding default responses and displaying custom error pages
  • Transitioning your website to a new domain or content source

With Amazon S3 website redirects, you can ensure the proper content is reaching your users while minimizing interruptions.

In this lab, you will configure two types of website redirects. In the first lab step, you will redirect traffic intended for one S3 bucket, to another S3 bucket that contains updated content. The second lab step will have you configure conditional redirects, a feature that allows you to define routing rules based on certain object keys or errors that users may encounter on your website.

Learning Objectives

Upon completion of this lab, you will be able to:

  • Redirect static website requests from one Amazon S3 bucket to another bucket
  • Configure conditional redirect rules based on S3 object keys and error codes

Intended Audience

  • Cloud Architects
  • Software Engineers
  • DevOps Engineers

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • Amazon Simple Storage Service (S3)

If you need a refresher, refer to the following labs:

Environment before
PREVIEW
arrow_forward
Environment after
PREVIEW
About the Author

Jun is a Cloud Labs Developer with previous experience as a Software Engineer and Cloud Developer. He holds the AWS Certified Solutions Architect and DevOps Engineer Professional certifications. He also holds the AWS Certified Solutions Architect, Developer, and SysOps Administrator Associate certifications. 

Jun is focused on giving back to the growing cloud community by sharing his knowledge and experience with students and creating engaging content.