Redirect All Subdomains to Main Domain
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,
-
Hello :) To clarify, are you asking for custom Mod_Rewrite rules as opposed to using the wildcard subdomains functionality? Thank you. 0 -
[quote="cPanelMichael, post: 1738892">Hello :) To clarify, are you asking for custom Mod_Rewrite rules as opposed to using the wildcard subdomains functionality? Thank you.
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 :)0 -
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. 0 -
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. 0 -
[quote="Jakez, post: 1740042"> 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?
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.0
Please sign in to leave a comment.
Comments
5 comments