Ends in
00
days
00
hrs
00
mins
00
secs
ENROLL NOW

🎁 Get 20% Off - Christmas Big Sale on All Practice Exams, Video Courses, and eBooks!

Customize Your Invite Links with Amazon S3 Website Redirect

Last updated on April 26, 2023

If you use Discord, Slack, or Telegram, you’re probably familiar with those long and complicated invite links used to join servers or channels. These links can be difficult to remember and may even discourage some people from joining. With URL redirection, you can create a custom and easy-to-remember domain name for your invite links. For example, you might use a domain like “discord.mycoolsite.com” that redirects to the invitation page of your Discord server, which might look something like this: “discord.com/invite/aabbCCDD”. Inviting people thru a custom domain can reinforce your brand and make it easier for others to share and join your online community. Another advantage is that if ever the invite link expires or you need to change it, you can do so without having to update it everywhere it’s been shared. Simply update the redirection settings to point to the new link.

When it comes to URL redirection, you’ve got a few options to choose from. You could use third-party services (e.g., bit.ly, tinyurl.com) or configure your web server (e.g., Nginx, Apache) to redirect visitors automatically. In this article, we’ll look at another method, yet a simpler alternative, using Amazon S3 website hosting and Amazon Route53.

To follow the tutorial, you must:

  • have created an S3 bucket.
  • have an existing hosted zone in Amazon Route 53
Tutorials dojo strip

Enabling the S3 bucket for website hosting

  1. Go to the Properties section of your S3 bucket.
  2. Search for the Static website hosting tab and click Edit
  3. Switch the Static website hosting option to Enable.
  4. For hosting type, select Redirect requests for an object.
  5. Under Host name, enter your invite link. In this demo, I wanted to redirect to a Discord invite link.
  6. For Protocol, choose https.
  7. Click Save changes.

When you turn on website hosting, Amazon S3 automatically designates an HTTP endpoint for the bucket in the format http://<bucket-name>.s3-website-<AWS-region>.amazonaws.com, where <bucket-name> is the name of the S3 bucket and <AWS-region> is the AWS region where the bucket is located. This endpoint cannot be modified or customized.

As a workaround, we can create a CloudFront distribution that uses the S3 bucket as the origin. Then we’ll provide a custom domain name for the distribution endpoint. As a workaround, we’ll create a CloudFront distribution that uses the S3 bucket as the origin. Finally, we’ll create a Route 53 record for the custom domain name that points to the CloudFront distribution endpoint.

Customize Your Invite Links with Amazon S3 Website Redirect

 

Creating a CloudFront distribution:

  1. On the left pane of the CloudFront console, click Distributions.
  2. Click the Create Distribution button
  3. In the creation wizard, paste your S3 website URL into the Origin domain.

Customize Your Invite Links with Amazon S3 Website Redirect

    4. Scroll down to the Settings tab.

    5. Enter the domain name that you like in the CNAME option.

    6. Under Custom SSL certificate, select the SSL certificate associated with your domain. If you don’t have it, you can request one from AWS Certificate Manager (ACM) for free.

    7. Leave everything to their default settings. Click Create distribution.

 

Customize Your Invite Links with Amazon S3 Website Redirect

Note that it may take several minutes for the CloudFront distribution to deploy.

Creating a Route 53 record:

  1. In the Route 53 console, Choose the hosted zone for the domain you want to use.
  2. Click Create record.
  3. On the Record name, enter the custom domain that you created for your CloudFront distribution.
  4. Enable the Alias toggle button.
  5. In the Route traffic to option, select your CloudFront distribution.
  6. Click Create records.

Customize Your Invite Links with Amazon S3 Website Redirect

 

Verification

Wait for the Route 53 record to propagate, which may take some time. Open a web browser and enter your custom domain name. You should now be redirected to the invitation page of your Slack, Discord, or Telegram channel.

Get 20% Off – Christmas Big Sale on All Practice Exams, Video Courses, and eBooks!

Tutorials Dojo portal

Learn AWS with our PlayCloud Hands-On Labs

Tutorials Dojo Exam Study Guide eBooks

tutorials dojo study guide eBook

FREE AWS Exam Readiness Digital Courses

FREE AWS, Azure, GCP Practice Test Samplers

Subscribe to our YouTube Channel

Tutorials Dojo YouTube Channel

Follow Us On Linkedin

Recent Posts

Written by: Carlo Acebedo

Carlo is a cloud engineer and a content creator at Tutorials Dojo. He's also a member of the AWS Community builder and holds 5 AWS Certifications. Carlo specializes in building and automating solutions in the Amazon Web Services Cloud.

AWS, Azure, and GCP Certifications are consistently among the top-paying IT certifications in the world, considering that most companies have now shifted to the cloud. Earn over $150,000 per year with an AWS, Azure, or GCP certification!

Follow us on LinkedIn, YouTube, Facebook, or join our Slack study group. More importantly, answer as many practice exams as you can to help increase your chances of passing your certification exams on your first try!

View Our AWS, Azure, and GCP Exam Reviewers Check out our FREE courses

Our Community

~98%
passing rate
Around 95-98% of our students pass the AWS Certification exams after training with our courses.
200k+
students
Over 200k enrollees choose Tutorials Dojo in preparing for their AWS Certification exams.
~4.8
ratings
Our courses are highly rated by our enrollees from all over the world.

What our students say about us?