How to add a subdomain as separate site?

Hi there! We’re brand new users of Cleaver, it’s an amazing tool that saves us a lot of work :cupid:!!

We’re having some trouble trying to set up a double enviroment for a simple static HTML site project on a DigitalOcean VPS.

Let’s say we have mysite.com for production and dev.mysite.com for development.

So far we created in Cleaver a site for mysite.com, added Let’s Encrypt SSL and everything is going through CloudFlare’s DNS, worked like a charm.

The we added a second site, dev.mysite.com, and everything went fine on Cleaver, buy anytime we hit dev.mysite.com on the browser it redirects to mysite.com. We used the same CloudFlare configuration that used to work with another tool we used (Laravel Forge): an A record for mysite.com pointing to the server IP and a CNAME record for dev subdomain for mysite.com.

Do we missed something when creating the server or the sites in Cleaver so the second site, dev.mysite.com doesn’t redirect back to mysite.com?

Thanks a lot!

Hi @abolo! Welcome to the forum and we’re glad you are enjoying Cleaver!

For a sub-domain, typically, I’d add the subdomain as an A record and point to the IP to the server the site will be hosted on.

Such as -
Add the a record, point to server

Select the record when creating the site

I hope that helps! Please let me know if you have any trouble.

Hi @amiedema! Thanks for the quick reply, we did what you suggested and now everyting is working fine :confetti_ball:!!

We had to change this DNS settings directly on CloudFlare’s panel because every time I tried to add a CloudFlare DNS Profile on Cleaver (after completing the form including API token) an Error 500 message showed up on a modal.

Beyond this little problem we have solved it, thanks a lot for your help!

You’re welcome @abolo , I’m glad you sorted it out!

Yikes! I see the 500 error if I enter an invalid API token. Thanks for bringing this to my attention! However, it does works if I use a valid API token.

Just to make sure, in Cloudflare > My Profile > API Tokens - did you use the global API token or did you create a new one from one of the available templates?

1 Like

Ah! That’s it!
I didn’t use the global API token, I created a new one from the templates. The global API token did the job.

Thanks again!

Perfect! I’ll get that 500 error to be handled a little more gracefully. Thanks again for letting me know!