Skip to main content
cPanel Technical Support has been heavily impacted by hurricane Beryl and our ability to respond to tickets has been hindered as a result. We appreciate your understanding and patience as we address these delays.

Is it good practice to use an addon domain for domains that should just redirect to the main domain?

Comments

12 comments

  • cPRex Jurassic Moderator

    Hey there!  If all the sites will end up pointed to the same place, I wouldn't even use an addon - I would use an Alias.

    https://support.cpanel.net/hc/en-us/articles/360055638573-How-to-create-an-alias-formerly-known-as-parked-domain-

    This just sets up an additional entry in the Apache configuration so all the domains get routed to the same content.  No redirection or customization of files is required.

    0
  • markus909

    Thanks cPRex

    to better understand (not new to this topic, but still not a master at all in it) when would you suggest to use an addon domain?

    I think when using "Ensure that the "Share document root (/home/username/public_html) with “domain.tld”." I am afraid that I am losing control. The thought that something else messes with the document root gives me not a good feeling. I think this goes back to some dialogue messages from cPanel as well, e.g. when you delete an addon domain it tells you that the document root is going to be deleted → such messages increase the fear that you could make a big mistake by deleting the wrong folder

    I think I try to better understand what it actually means when a document root is shared. For actual websites (e.g. second website of the same client) I would never want that. Even backup/restore will become difficult and complicated I think; setting up different PHP versions will be more complicated; I assume there are many other situations

    This just sets up an additional entry in the Apache configuration so all the domains get routed to the same content.  No redirection or customization of files is required.

    Sounds like then no `.htaccess` file is generated in that case, right?
     

     

    0
  • mtindor

    A reason why you would want to create an Alias versus redirecting the domain (via the registrar for example) is so that you can have SSL coverage on all of the domains, and not just on the primary domain.

    You are right that nothing is done in .htaccess when adding an alias.  So, if it's a Wordpress site, you are then counting on Wordpress to handle the redirection (which it will do typically behind the scenes).   But adding something to .htaccess afterwards to force redirection of the non-primary domains, after you have added those domains to cPanel as aliases, is probably a better method - if you know how to do that properly.

    0
  • markus909

    I see there are several ways of doing redirects, i.e. redirect mywebsite.de to mywebsite.com:

    1. On the DNS or nameserver level e.g. page rule with Cloudflare
    2. On the domain registrar level if they offer it as a feature (it'll probably depending on the domain registrar also just be some kind of page rule like I know it from Cloudflare)
    3. Separate cPanel account for the redirect-domain, e.g. two separate cPanel accounts like mywebsite.com and mywebsite.de. On mywebsite.com you run the WordPress website. On mywebsite.de no WordPress is installed, but a permanent redirect is added via cPanel. That will automatically modify the .htaccess and add the redirect to that file
    4. Addon Domain for redirect-domain added to the main domain mywebsite.com (i.e. cPanel account). Add the addon domain to a separate document root e.g. `home/username/addon/mywebsite.de`. Then do the same and add a redirect via cPanel which will write the rule into .htaccess
    5. Alias domain which basically is similar to 3. but instead shared the document root with the main domain

    Setting up an empty WordPress at mywebsite.de only to do redirects with a WordPress plugin to mywebsite.com is a no go.

    Sharing the same document root is something that requires upfront trust that everything works out without conflicts. Sharing the same document feels to me more like a workaround than a solution, but probably that's just how it always has been, and as a newbie I am questioning such things.

    Definitely hope we can go on in that discussion, I can't imagine I am the only one having those thoughts

     

    0
  • cPRex Jurassic Moderator

    Use an Addon Domain when you want to host a completely separate website on the same cPanel account.

    Use a Park/Alias when you just want domainB to point to domainA.  Since there is no additional content created, all you need is the Alias configured and DNS pointed to the correct IP.

    Anything more than that is just making it complicated :D

     

    0
  • markus909

    My goals truly is to make it less complicated. I think cPanel comes with a big history so for someone who learns all of it now, many things seem a bit irrational. 

    I changed already the setup for those few domains and followed your advice. It's not stating anywhere that those are "Alias" domains. I think all those terms come also from the previous cPanel versions.

    If you worked with it for years, you know those are alias domains. For me it's just an addon domain that shared the same document-root (therefore it is an alias domain).

    Basically I could say, the simplification in cPanel (aggregating subdomain, addon domain, parked domain, alias domain all to the domain settings within cPanel) is only on the surface. Everything works the same in the background. Of course, I can't say for sure, I never worked with it and just have seen the screenshots from previous cPanel versions.

    However, I am learning every day, and your help is very appreciated. I am happy that I am now addon-domain-free which simplifies things

    1
  • markus909

    cPRex can you check one more thing on your end? I am now using Alias domains (same document root as main domain) instead of Addon-domains (different document root as main domain). This works to redirect to the main domain.

    Now I find the menu "Parked Domains (Domain Aliases)" in WHM, and see the domains listed there. Is this the same for you? Overall, I didn't think all of it has anything to do with Parked Domains, so I was surprise to see them now listed here

    0
  • cPRex Jurassic Moderator

    Yes, that's the same entry, just a different page for it.

    0
  • markus909

    I could try to just delete a parked domain and figure out, but I try also to stop messing with the current setup that works now.

    So parked domains are now equal to alias domains?

    And every alias domain is now automatically shown in the page for parked domains. That means if I delete the parked domain, I would automatically delete the alias domain (i.e. the redirect won't work anymore)

    (sound like a silly question, but when you think about it it's not so easy to follow unfortunately)

     

    0
  • cPRex Jurassic Moderator

    Yes, Alias is the modern word for Park.

    0
  • markus909

    Got it - thanks

    0
  • cPRex Jurassic Moderator

    Sure thing!

    0

Please sign in to leave a comment.