Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How to redirect multiple domains to a single domain ?

Discussion in 'General Discussion' started by spanna, Jul 21, 2014.

  1. spanna

    spanna Registered

    Joined:
    Jul 21, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I would like to know how to setup my server to catch all Name Servers which are pointed to my server. There are around 40-50 domains pointed at my nameserver and I would like to redirect all of them to my primary domain.

    Actually the point is... I had a hosting client, who stopped paying me, so I deleted his account but their nameservers at still pointing at my nameservers. I would like to know if there's a way I can get their traffic with out the need of creating accounts for each domain.
     
  2. vanessa

    vanessa Well-Known Member
    PartnerNOC

    Joined:
    Sep 26, 2006
    Messages:
    830
    Likes Received:
    26
    Trophy Points:
    178
    Location:
    Virginia Beach, VA
    cPanel Access Level:
    DataCenter Provider
    You can alter the default docroot. To do this:

    Code:
    cp /var/cpanel/templates/apache2/main.default /var/cpanel/templates/apache2/main.local
    
    Edit this:

    Code:
    # Default vhost for unbound IPs
    
    <VirtualHost *>
        ServerName [% servername %]
        DocumentRoot [% serverroot %]/htdocs
        ServerAdmin [% serveradmin %]
        [%- IF supported.mod_suphp %]
        <IfModule mod_suphp.c>
            suPHP_UserGroup nobody nobody
        </IfModule>
        [%- END %]
        [%- IF supported.mod_userdir && userdirprotect_enabled && defaultvhost.userdirprotect != '-1' %]
        UserDir disable
        [%- IF defaultvhost.userdirprotect != '' %]
        UserDir enabled [% defaultvhost.userdirprotect %]
        [%- END -%]
        [%- END %]
    </VirtualHost>
    
    You'll want to put the docroot of where your site files are located, and adjust the user/group as needed. Then:

    Code:
    /scripts/rebuildhttpdconf
    service httpd restart
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,323
    Likes Received:
    1,851
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can also edit the default website page via:

    "WHM Home » Account Functions » Web Template Editor"

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice