By newbie
Hello, i need to create 2 subdomains along with my site in one droplet.
ex: mysite.com ( simple html based website) site2.mysite.com ( codeigniter framwork based app) site3.mysite.com (wordpress)
so should i create separate virtual host for each subdomains or should i create folders and point those folders using redirect rules in main virtual host file. also is it possible to accomplish my above requirement this way?
please suggest me which method should i chose and why?
thanks in advance
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi!
The recommended and easiest way to do it would be creating a separate server block for each website/subdomain.
Check out the following tutorial:
The tutorial walks you through creating two separate server blocks. You’ll want to create three, one of each domain that you listed.
Make sure you add DNS records for each domain so that they point to your Droplet’s IP address:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.