The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect All Subdomains to Main Domain

Discussion in 'General Discussion' started by Jakez, Sep 26, 2014.

  1. Jakez

    Jakez Registered

    Joined:
    Sep 26, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    My apologies in advance if you see any sign of noobness - I will try to be as clear as possible.

    I have a ton of domains added as the parked domains in my Cpanel. What's the best way to achieve that any subdomain, including parked domains, should resolve to Main domain? Since I need to add parked domains on a regular basis, adding a wild card subdomain every time may not be super convenient. In short, what I am trying to get here is the following redirection:

    MainDomain.com --> MainDomain.com
    whatever.MainDomain.Com --> MainDomain.com
    whatever.ParkedDomain1.com --> MainDomain.Com
    whatever.ParkedDomain2.com --> MainDomain.com
    whatever.ParkedDomain.com/whatever --> MainDomain.com

    In short, anything and everything that hits on any of my subdomain, directory or just any URL of my parked domain, should land on a single, static fixed Page, everytime.

    I somehow managed to get it a bit functional by using .htaccess - However it didn't completely server my purpose when it came to using parked names. Any input from experienced server administrators here would make my day.

    Thanks,
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. Jakez

    Jakez Registered

    Joined:
    Sep 26, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi Michael,

    Exactly, That's what I was asking :)
    However I seem to figure out one part of that and now I want to resolve the last piece of the puzzle. Is it possible to correctly resolve any domain name (say, wildcard) to my server even though I haven't created an account for that domain?

    I have created my custom nameservers and they are working want. What I want, that any domain which uses my nameservers, should be presented with a static page without any need to create the associated domain account in my WHM/Cpanel. So, such a wildcard acceptance by nameserver is possible?

    Thanks :)
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The "Default Website Page" should be visible by default for domain names that resolve to the server but have no VirtualHost, and it's editable via:

    "WHM Home » Account Functions » Web Template Editor"

    Thank you.
     
  5. Jakez

    Jakez Registered

    Joined:
    Sep 26, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi Michael, :)

    The default website page template works for the cases where I have "created" an account for clients domain and he hasn't uploaded any files yet. Or there was an account which is now deleted - in any case, the default website page template is applicable if there is "any" kind of entry in the system cluster for that particular domain name.

    My problem is the scenario, that how to resolve a domain name which has no entry in the system cluster - past or present. The server has never heard of this domain name, in any manner. Only the nameservers on domain registrar have been pointed to me. How to present a static page to that?

    The domain name starts resolving fine as soon as I create a cpanel account for that name. It still presents the template page even after I delete that account. But before creating any entry, the domain simply doesn't resolve to any page.

    Hope I am clear this time. Sorry for the confusion in my last post.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    There needs to be an "A" record configured for the domain name so it points to an IP address associated with your server. If it's been assigned name servers associated with your server, then you must create the DNS zone.

    Thank you.
     
Loading...

Share This Page