简体   繁体   中英

Point domain to subdomain of another domain

I've been having troubles solving this issue for a couple of days now. Let me explain what's going on.

The users of my website get a wildcard domain name to use. They can create a simple website using that subdomain name.

Recently, I've started offering them to purchase a domain name through the website. The idea was that the domain name they purchase should show the same website as the wildcard domain.

I've figured that I could achieve that by pointing the domain name to that subdomain name. But, I am not sure whether or not that is possible and how I can achieve it. Btw, I have access to both cPanel and WHM, so I can freely edit the DNS zones and create accounts if required.

Thanks in advance for your help!

I am not the best at this, but I would think you would have to create a vhost for every domain that has been registered and point it to the proper directory.

If you want to do it with DNS I suppose you have to set a CNAME for *.domain.tld to the proper subdomain. But I don't know if that would at some point redirect them to their original subdomain.

just follow these steps.

  • add a cname record in main.com dns mapping to the subdomain you like
  • eg. example.com. CNAME example.maincom.

Done

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM