Question

Why does my subdomain point straight back to my main website login page?

So, I was expecting my subdomain to be an entirely different environment where I can add different code. Ok - I have not waited the whole 3600 seconds. Will that change or have I done something wrong?

OK, So I am following the docs, on how to create a subdomain: https://docs.digitalocean.com/products/networking/dns/how-to/add-subdomain

When entering the new subdomain host field it automatically appends this to my existing domain name, so mysubdomain.mymainsite.com.

Then, the “will direct to” field is automatically filled with the “mymainsite”. The resulting DNS A record comes out as “mysubdomain.mymainsite.com”.

Here is the kicker: when I enter into my browser, “mysubdomain.mymainsite.com”, it just goes straight to the login page for “mymainsite.com”.


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

This does not sound like a DNS problem, as if it was a DNS problem, you would be getting an error saying that the subdomain can not be resolved and it would not load at all.

It sounds like a server configuration issue.

In case that your main domain and subdomain are hosted on the same server, you need to make sure that you have done the necessary server-side configuration in order to be able to host two separate websites.

For example, if you are using Apache, you need to make sure that you’ve added a new Apache virtual host as there the instructions here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-18-04

Or if you are using Nginx, you need to make sure that you’ve setup separate Nginx server blocks as per the steps here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

If you are using WordPress, you could take a look at this video here:

Best, Bobby