0

I have LAMP stack setup on ec2 instance and bind it with a custom domain using AWS Route 53 hosted zone. e.g. example.com and www.example.com.

Now i want to redirect www.example.com and example.com to a subdirectory path e.g. example.com/blog.

I tried to setup a static website hosting at S3 and used redirection rule but it doesn't work. Can someone please help here. I am totally stuck....

Thansk Deepak

Deepak S
  • 11
  • 3
  • Try to point domain to the sub folder in apache2 conf as mentioned in https://stackoverflow.com/questions/6307047/different-folder-as-website-subfolder – Ali Jun 11 '21 at 11:44

1 Answers1

0

Try using an an Application Load Balancer for serving traffic to the ec2 instance and utilise listener rules for redirecting traffic to desired paths. You can take reference from here - https://towardsaws.com/utilising-listener-rules-for-load-balancing-using-aws-application-load-balancer-8e090e0ba469

Kavish Baghel
  • 179
  • 1
  • 5