Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Member
    Join Date
    Jul 2009
    Posts
    15

    Default Point AddOn Domains to same folder?

    Hi,

    I'd like to automatically point all my new domain registrations to a single webpage eg,
    "Home of Domain.com
    Hosted by Hosting Company"

    I was going to create an addon domain for each new domain using the API's and point all the domains to the same folder with the default index page.

    However you cannot point more than one domain to a location.

    Any suggestions? A skeleton directory for all add on domains or something?

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Lightbulb

    Quote Originally Posted by hostb View Post
    Hi,

    I'd like to automatically point all my new domain registrations to a single webpage eg,
    "Home of Domain.com
    Hosted by Hosting Company"

    I was going to create an addon domain for each new domain using the API's and point all the domains to the same folder with the default index page.
    An "Add-On" domain would be a very stupid move for what you are asking for namely because that not creates a lot more work for you every time you get a new domain but also has absolutely nothing to do with what you are asking for!

    In the manner you are asking, PARKED domains would be more appropriate but even then I wouldn't use those as you'll see further below.

    However you cannot point more than one domain to a location.
    Where in the world did you get that idea from?

    What you are describing is called "PARKED" domains!

    "ADD-ON" domains have their own folder and separate FTP login but "PARKED" domains are aliases for the same address. In other words, parked domains give you an extra domain to get to the same web site!

    Now with that said, I would use neither of these as you'll see in your next question.
    Any suggestions? A skeleton directory for all add on domains or something?
    A skeleton directory would be part of what you should do in that you should drop in a default "index" page with a redirect to your default page as it makes less files for a client or you to have to delete later when building new web sites.

    Incidentally, unless you are a reseller, your skeleton folder is located at /root/cpanel3-skel/

    In example, you could drop in an index.php file into the skeleton such as:
    Code:
    <?php  header("Location:  http://1.1.1.1"); ?>
    (Where 1.1.1.1 would be your main server's shared IP address)

    Placed in the /public_html of the skeleton folder, this index.php would automatically be copied upon new web hosting account creation.

    The next thing I would do is replace the files of your DEFAULT web site which is the web site that is displayed automatically when someone connects to your server by IP address or in the case of domains pointing to the server which have not yet been setup as an account on the server and normally displays the default cpanel page if it hasn't been updated.

    That site is located in: /usr/local/apache/htdocs

    This is where you would put your "Hosted by Hosting" whatever pages and would show up for any domains that point to your server where you have not yet setup any hosting account for those domains.

    For those where you do setup an account, they would still display that same page because of the skeleton index.php file until new web files were uploaded for the new web site replacing that redirect.
    Last edited by Spiral; 07-18-2009 at 08:58 PM.

  3. #3
    Member
    Join Date
    Jul 2009
    Posts
    15

    Default

    Hi,

    Thanks for the reply.
    I suggested addon domains because,
    1.) I wanted the domains url to remain in the browser address bar for my 'parked' pages. This would not happen using parked domains.

    2.)But most importantly for the local domains I sell, they must resolve correctly to a nameserver for the domains regulator to approve the domain. So in a way they always need some sort of 'hosting'

    So I must put them on my nameservers somehow.

    The only way to get the domains onto my nameserver automatically is add
    them with the cpanel API's as either new, parked or addon

    My /root/cpanel3-skel/ directly contains a default page for full hosting accounts. So I can't change that.

    I hope my question sounds a little less stupid now.

  4. #4
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Lightbulb

    Quote Originally Posted by hostb View Post
    1.) I wanted the domains url to remain in the browser address bar for my 'parked' pages. This would not happen using parked domains.
    That's Wrong!

    With parked domains, the domain you used to reach the site remains in the URL address bar!

    I have many servers with hundreds of parked domains and I can tell you first hand that the parked domains stay in the url bar and you can even navigate to different web pages in the site and the parked domain STILL stays up the URL bar showing as the site you are connected to the entire time!

    I can give you hundreds of examples and in each and every one, the domains -- just mere parked domains --- appear
    to be the main domain and you are totally and completely unaware they are "parked" domains.

    The only time you would get the domain in the URL change is if you used a redirect or a hyperlink to a different domain name but a "parked" domain is NOT a redirect and the domain shown in the address bar *IS* the "parked" domain you typed to originally get to the web site and does not change! Apparently, you somehow got the notion that a parked page is a redirect and gets updated to the main domain when you connect, but that is completely incorrect!

    A parked domain is fully a secondary name for the "web account" on the server. It is NOT a redirect to the main address!

    (Incidentally redirects can be generated by Apache such as web file redirects or .htaccess redirect commands (OR) by DNS such as using a CNAME record instead of an A record. Parked domains uses "ServerAlias" which is different and the web server cannot distinguish the parked domain from the main domain as they are equals and the server answers to both domains and delivers the content found at DocumentRoot for the account)

    Code:
    <VirtualHost x.x.x.x:80>
        ServerName mydomain.com
        ServerAlias www.mydomain.com parkeddomain.com www.parkeddomain.com
        DocumentRoot /home/login/public_html
    2.)But most importantly for the local domains I sell, they must resolve correctly to a nameserver for the domains regulator to approve the domain. So in a way they always need some sort of 'hosting'
    Again you are wrong!

    You do not need to setup any hosting account at all!

    Most registrars do not require DNS to be setup in advance of hosting but for those few that do (and some countries), you still do NOT need to setup a hosting account but rather just simply the DNS zone file for the domain and nothing more. Drop in a simple zone file pointing to your default shared IP and everything I said before will work just fine and the registrar will be able to resolve the zone for the domain at your DNS servers. So I must put them on my nameservers somehow.

    The only way to get the domains onto my nameserver automatically is add them with the cpanel API's as either new, parked or addon
    Once again you are wrong!

    Setting up "parked" or "addon" domains or hosting accounts is NOTthe ONLY way to get domains in to your nameserver.

    There is also "Add a DNS Zone" listed under "DNS Functions" that generates the exact same zone files as creating any of the above but is actually even simpler because you don't have to specify a username or password or anything. Just type the name of the domain and that's it!

    Like "parked" and "add-on" domains, adding DNS zones can also be done through the cPanel API functions automatically as well just the same!

    My /root/cpanel3-skel/ directly contains a default page for full hosting accounts. So I can't change that.
    That's the whole point. You were updating the page for the "hosting accounts" you were creating!

    However, for what you are talking about with adding new domains, you really
    don't even need to do any of that as you already would have a page setup for the domains before hand and don't even need to setup any hosting account for the new domains in the first place, not until you are actually ready to host the domains and then you can deploy your "full hosting account" skeleton at that time or whatever you want to do!

    Setting up the redirect page in the skeleton was just a little extra icing to have redirects AFTER the hosting account was created but is totally optional and completely unnecessary in your case since you already have the page setup for the new domains already anyway from the default IP address page I told you about previously.

    I hope my question sounds a little less stupid now.
    Actually just the opposite as it makes it more clear you don't have a full grasp on what you can and can't do with Cpanel or how thing operate although that is something we can hopefully help you remedy around here!
    Last edited by Spiral; 07-19-2009 at 05:25 PM.

  5. #5
    Member
    Join Date
    Jul 2009
    Posts
    15

    Default

    Thank you for so much detail. I am always amazed at the time some of you people put into helping the newbies out.

    I wanted to park domains but have them 'redirect' to say /public_html/parked_domains/index.html. But I guess that is an addon domain. And that is why I always get the URL change. Because I effectively do a redirect.
    So if I understand correctly a parked domains will always work as an alias to only the root directory of the web page. Man I think I'm answering my own questions here, sorry.

    But I think you came up with the solution for me. I could use a spare IP that still will show /usr/local/apache/htdocs.

    I can then add all domains (ordered without hosting) as a DNS zone using that IP. And as you say I can still use the API's to automate the process.

    Also that way the URL won't change.

    So you think that is a good solution?

    EDIT: Is there a problem deleting a domain added as a DNS zone in WHM. I just tested it. The DNS deletion didn't work in WHM. And now when I try to park the domain again in cPanel it just ignored cPanel park and the WHM end over rides it as if the DNS zone is still in WHM.
    Last edited by hostb; 07-19-2009 at 02:08 PM. Reason: Extra question

  6. #6
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Lightbulb

    Quote Originally Posted by hostb View Post
    Thank you for so much detail. I am always amazed at the time some of you people put into helping the newbies out.
    I'm a hopeless posting addict

    I wanted to park domains but have them 'redirect' to say /public_html/parked_domains/index.html. But I guess that is an addon domain. And that is why I always get the URL change. Because I effectively do a redirect.
    So if I understand correctly a parked domains will always work as an alias to only the root directory of the web page. Man I think I'm answering my own questions here, sorry.
    Parked domains = Alternate additional web address for the same site

    Addon Domain = Additional domain added to the account that is setup
    to operate as it's own separate web site under a subfolder of the
    main hosting account and has it's own FTP login.

    Neither Add-on domains nor Parked domains are redirects. The difference
    is whether you want to the domain to have it's own separate web site
    or bring up the same web site as something else that already exists.

    Now one thing you may not have considered but what you just mentioned
    in having thing setup under /public_html/parked_domains is that you could
    setup the first domain as an "Add-On" domain pointing to that folder and
    then all subsequent domains as "Parked" domains laid on top the first and
    utilize both, that way none of the domains are redirects and all of them
    are pointing to the same subfolder. Just an example of how to do what
    you just mentioned folder wise above.

    But I think you came up with the solution for me. I could use a spare IP that still will show /usr/local/apache/htdocs.
    True, you could use any IP on the system. The advantage of using something other than the main shared IP is that you could still have the main cPanel default page plus your own default page for the other IP.

    The best way to set that up is to setup one account with a dedicated IP and then make it a reseller and setup the IP to be the main shared IP for the reseller. By doing that, the system will allow you to use the secondary IP as another shared IP and you can have multiple hosting accounts with the same IP and as many domains as you wish on the IP.

    I can then add all domains (ordered without hosting) as a DNS zone using that IP. And as you say I can still use the API's to automate the process.

    Also that way the URL won't change.
    Yes and yes ..... Setup DNS Only ...... Use the API for full automation.

    So you think that is a good solution?
    That's definitely the easiest. Any other way would cause more work in other areas and unnecessary extra steps you would have to deal with.

    EDIT: Is there a problem deleting a domain added as a DNS zone in WHM. I just tested it. The DNS deletion didn't work in WHM. And now when I try to park the domain again in cPanel it just ignored cPanel park and the WHM end over rides it as if the DNS zone is still in WHM.
    No, there is no problem deleting DNS zones in WHM or the API. I have never myself had any problem deleting domains and re-adding them as a full hosting account although I have fixed occasional glitches with that in other people's cPanel servers and they are generally quite rare.

    However, if you should run into such an issue (mostly doing something wrong in those cases more often), you can go into /var/named and manually delete the zone file (domain.com.db) and edit /etc/named.conf and remove the section for that particular domain zone and then you should be able to add the domain without any further problems.

    PS: Speaking of "doing everything", did you restart your named (DNS) server after deleting the zone?
    Last edited by Spiral; 07-19-2009 at 06:03 PM.

  7. #7
    Member
    Join Date
    Jul 2009
    Posts
    15

    Default

    You have been a great help. Thank you very much for all the time and effort. I'm glad I asked here first now.

  8. #8
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    Quote Originally Posted by hostb View Post
    You have been a great help. Thank you very much for all the time and effort. I'm glad I asked here first now.
    No problem. Glad to give you a hand.

  9. #9
    Member
    Join Date
    Sep 2002
    Location
    AZ
    Posts
    14

    Default

    Spiral...

    I have a similar request..

    However I know I want to use parked domains.

    The difference is I want the parked domain to not park in the main domains public_html folder I want a given parked domain to resolve in a subfolder of that domain.

    Is there a way with htaccess or a php script once I park the domain to have htaccess or script then have the domain use a subfolder as its root folder?

    maindomain.com/parked1

    maindomain.com/parked2

    maindomain.com/parked3

    parked domain 1 will resolve in this folder maindomain.com/parked1

    parked domain 2 will resolve in this folder maindomain.com/parked2

    parked domain 3 will resolve in this folder maindomain.com/parked3

    or maybe there is a way through whm to set these up that you know of?

    Thanks for any assistance you can offer.

    Richard Wing

  10. #10
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    Hello Richard,

    You can simply use the add-on domain feature in order to achieve this.

    Add-on domain feature lets you point a domain to a particular sub-folder of the main domain.

    For example,

    parked1.com >> maindomain.com/parked1

    parked2.com >> maindomain.com/parked2

    parked3.com >> maindomain.com/parked3

  11. #11
    Member
    Join Date
    Sep 2002
    Location
    AZ
    Posts
    14

    Default

    Thank you.

    I knew how addons work. I was hoping to set them as parked so I can still use content / scripts from the main domains sub folders. I want to share the content qand scripts.

  12. #12
    Registered User
    Join Date
    Aug 2009
    Posts
    4

    Exclamation

    [QUOTE=Spiral;544797]I'm a hopeless posting addict

    Addon Domain = Additional domain added to the account that is setup
    to operate as it's own separate web site under a subfolder of the
    main hosting account and has it's own FTP login.



    Hi there! This is what I am trying to do:

    I have two domain names, both registered with namecheap, then pointed to FloatHosting. I have not done any work on my original domain, however, the second addon domain is a separate website and should not in any way be linked to the original one. Everything works perfectly except for the fact that it shows up under the original domain name when I typre that into the browser. If I type in the domain name it should be under, it tells me the files cannot be found. So obviously the files for domain name 2 have gone under domain name 1. How do I fix this? I really, really new at all this so I didn't understand most of the stuff you said in this thread. Can you maybe dumb it downa bit for me please? lol I know I must sound really stupid but ANY help would be greatly appreciated.

    The website needs to be finished like yesterday

    I also read on another thread that it might have something to do with the fact that I have the X theme on cPanel? An that it needs to be changed by Floathosting? Or that they need to change something regarding folders. I have been in contact with FloatHosting support, however they have not replied or helped me with this issue.

    Is there anything i can do to make it work?

    Thank you!
    Nina

    P.S. here is a link to the other thread.
    http://forums.cpanel.net/f4/addon-do...er-115825.html

  13. #13
    Registered User
    Join Date
    Aug 2009
    Posts
    4

    Talking

    OH MY WORD! i got it to work.. now i feel really dumb
    thanks anyways!

Similar Threads & Tags
Similar threads

  1. User able to addon domains that do not point to the server.
    By jols in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 09-04-2009, 07:20 PM
  2. Addon domains in custom folder
    By SilviuB in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 08-31-2009, 09:34 AM
  3. Replies: 1
    Last Post: 06-21-2008, 06:50 PM
  4. SSL Certificates for 2 domains that point to same folder in server
    By veronicabend in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-08-2006, 09:58 AM
  5. Addon Domains Point to Wrong IP
    By mrcbrown in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 11-01-2003, 03:12 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube