How can I add subdomain as alias in digitalocean?

Posted October 21, 2021 104 views
WordPressDigitalOceanDNSDigitalOcean Droplets

I have droplet with wordpress on DO. Also I have cloudfare A type record as (ip is droplet ip). It working well but I want adding new alias as If user enter he get my WP site as hi enter I added in cloudflare A record for (ip is droplet ip) and added in DO networks new A record for But is redirected to What I am doing wrong?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


There are a few things that I could suggest here:

  • If you are building a separate website for your reviews subdomain, I would recommend creating a new Apache Virtual Host so that the reviews subdomain could have its own document root and Apache configuration. You can follow the steps on how to do that here:

  • In case that you want the reviews subdomain to share the same files as your main website, for example, you would need to do that if you are building a WordPress Multisite. Then you need to edit the Apache virtual host for your main site and under the ServerAlias list add your reviews subdomain.

Note that in both cases after making the change to your Apache configuration, you would need to run a config test with:

sudo apachectl -t

And only if you get Syntax OK then start Apache.

Hope that this helps!

by Lisa Tagliaferri
This tutorial will guide you through setting up multiple domains and websites using Apache virtual hosts on an Ubuntu 18.04 server. During this process, you’ll learn how to serve different content to different visitors depending on which domains they are requesting.