1

I don't know if this is the right place to post this but I am so much in deep confusion right now.

I have a static WP website hosted in Fastcomet with a domain name www.example.com (namecheap) and also a web app made in Laravel hosted in AWS (free tier).

Now what I want to achieve is I want to create a subdomain www.app.example.com that will redirect to my laravel web app. How can I achieve this kind of scenario? Should I add subdomain to Fastcomet or in AWS? and also what is the correct term for this problem so that I can easily search in google for further reference.

2
  • Where is your DNS hosted? If you don't know, login to your domain registrar and see where you NS records point. Commented Sep 10, 2020 at 20:24
  • my DNS hosted at namecheap.com
    – rayncorg
    Commented Sep 11, 2020 at 3:27

1 Answer 1

1

Based on the information you have provided, below is one solution I can think of.

Assuming you are using the name servers provided by your hosting provider, they should be able to help you with editing the DNS zone file for your domain. There you have to create a CNAME record for www.app.[yourdomain]. The value should contain the public DNS name (if provided by the AWS for your App). In case you have a static IP (I think AWS calls it Elastic IP) and you have associated that with your App, you can create an A record instead of CNAME. The A record's value should contain the AWS provided IP. (Create either A or CNAME but not both. Creating both is not possible.)

In my solution, I haven't talked about "redirect". In case you are particular about a redirect, then you have to create the subdomain under your domain with the hosting provider and not AWS. On the subdomain, you can create an index file that redirects to the App. (You can also do that via htaccess in case of an Apache server.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.