I recently signed up to a service which allowed me to replicate the contents of files in a subdomain on my server. So abc.myserver.com shows the same content as xyz.theirserver.com.

All I had to do was create a CNAME record on myserver.com with abc.myserver.com and point to xyz.theirserver.com.

No files reside in abc.myserver.com, there isn't even a real subdomain there.

I am trying to replicate that so I can allow others to show files from my server on their subdomain/domain, I created a CNAME record similar to above but it didn't work.

How can I achieve this?

  • Are you wanting them to be able to display the files that you are already replicating or something completely different?
    – Steve
    Commented Oct 11, 2020 at 6:50
  • No so the real files will reside on my server. Want to do it like the example I mentioned.
    – Abu Nooh
    Commented Oct 11, 2020 at 8:49
  • 1
    What webserver are you using?
    – MrWhite
    Commented Oct 12, 2020 at 2:15
  • 1
    "there isn't even a real subdomain there" - the CNAME record is what "creates" the subdomain. This is as "real" as any other subdomain, it's just that it points to a different server.
    – MrWhite
    Commented Oct 12, 2020 at 2:30

1 Answer 1


There are two parts to showing content at a subdomain:

  1. Using DNS to point the subdomain to a server. The CNAME for your subdomain is pointing your subdomain to their server (the same server that their xyz subdomain uses.)

  2. Configuring the server to show the desired content when it gets a request for the subdomain.

You are missing the second part. It sounds like they have xyz set up as the default virtual host for their server. When a webserver gets a request for a domain or subdomain that doesn't have its own configuration, most web servers will show the default site.

Under Apache and Nginx webservers, the default site is the virtual host that comes first in the configuration. If all the virtual hosts are listed in the same file, it should be the one at the top of the file. If each virtual host is defined in its own file, the default virtual host should be the first file in alphabetical order.

  • Thanks for that. I'm using a litespeed Web server. How can I achieve the second part?
    – Abu Nooh
    Commented Oct 14, 2020 at 6:36
  • I don't have experience in LiteSpeed, but based on openlitespeed.org/kb/… it looks like you can use a * wildcard domain match assigned to a virtual host under "WebAdmin console > Listeners > Virtual Host Mappings" Commented Oct 14, 2020 at 9:23
  • Thanks I'll give that a go
    – Abu Nooh
    Commented Oct 15, 2020 at 19:34

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.