Please forgive me (and please correct) if I misuse jargon and terminology -- web hosting, administration, etc. is new to me.

Say I want to host a site at each of the following addresses:

  • http://www.aexample.com
  • http://aexample.com
  • http://www.a.example.com
  • http://a.example.com

I would like the underlying content to be the same at each address.


  1. What is the proper approach to achieve this?
  2. How many (and which) domains do I need to own? This is the crux of my confusion: Do I have to own example.com and aexample.com to achieve a.example.com or can I just add the subdomain?
  3. What is the proper forwarding | redirecting | aliasing to be completed?
  • Get aexample.com and example.com domains. Setup required sub-domains. Point all to the same hosting. Don't forget to set canonical to avoid duplicate content.
    – TopQnA
    May 22, 2018 at 2:13

1 Answer 1


First, when you obfuscate things or for documentation purposes, please use guidance from RFC2606 to select the names to be used.

Now to get to your questions:

  1. Like for any other cases you need both to set up DNS entries so that each name is resolved at the end to the server where the sites live. This is usually done through A/AAAA records or CNAME ones depending on the situation, but your question is too broad, it depends on who exactly host your DNS and your webserver. Then you need to configure your webserver to reply for the given names

  2. You have to own in some way both example.com and aexample.com since you will need to modify their DNS configuration

  3. There is no concept of forwarding/aliasing/redirecting here, except if you want any of the following:

  • when typing one of the name, being redirected to another one, which will show in the address bar of the browser
  • showing content from one website on another one, without changing the URL (this will be proxying).

Your questions is very broad and has no very specific constraints so you should be able to find many resources explaining all of this in more details.

  • 1
    Technically you could contact the owners of example.com and try to buy just a.example.com from them without owning example.com. I don't think most domain owners would sell a subdomain like that, partly for security reasons. May 21, 2018 at 15:39

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.