Domain redirection to external website provider (Squarespace) and also AWS EC2 instance based on url

0

We have two applications in single AWS EC2 instance. And our primary domain is lets say https://www.ourwebsite.com is pointed to this AWS EC2 instance. 1. Website with url - https://www.ourwebsite.com 2. Admin Application url - https://www.ourwebsite.com/adminapp

Now we have website designed in squarespace with url - https://ourwebsite.squarespace.com/ We want to go live this squarespace website. For this we need to redirect the user to this squarespace site. I mean, 1. When user tries url https://www.ourwebsite.com then it should be served from squarespace. 2. When user tries to access our admin application using url https://www.ourwebsite.com/adminapp , it should go to our existing AWS EC2 instance.

Appreciate your guidance to achieve my above goal. Thanks

1 Answer
0
Accepted Answer

2 Options

  1. If you are using an ALB then create redirect rules that redirects anything to your website to the new website
  2. On your webserver, create a redirect which you will need to keep your EC2's up and running for some time.
profile picture
EXPERT
answered a year ago
  • Okay. Thanks. Can you also help how to achieve the below use case?

    When user tries to access our admin application using url https://www.ourwebsite.com/adminapp then it should be served from our existing EC2 instance where we have hosted our adminapp in IIS.

    Thanks in advance.

  • Thats fine, if using an ALB have a rule in position 1 that directs anything to /adminapp to the EC2 (Target Group) Rule 2 will redirect the domain to the external web provicer

    Are you using an ALB?

  • No. We have Route53 to manage domain.

  • You have no alb and allow direct access to the ec2? Ok then you will need to setup redirect in iis This may help https://www.pluralsight.com/blog/tutorials/iis7-redirect-windows-server-2008

    You may wish to consider moving to an alb for the extra functionality and the ability to add waf etc

  • Okay, Thanks for your guidance.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions