1

I'm a software dev, but I'm green when it comes to web development and domain management.

Let's say I've registered some domains:

  • apples.example
  • bananas.example
  • cherries.example

...and [with a separate company] I'm on a "premium Shared Hosting" plan (includes "unlimited websites, unlimited parked domains, 100 subdomains").

I want to have all the domains point to a single website, so that users who enter any of the domain names all see the identical page except for a button encouraging the user to add the item named in the domain to their "shopping cart" or whatever.

Example:

  • if a user navigates to apples.example, they are brought to a page that includes a button Add apples to cart.
  • if a user navigates to bananas.example, they are brought to the same page, except the button action is now Add bananas to cart.

I am being told that this is not possible with a single page, and that therefore I'll need to add each domain to the host one-by-one via cPanel's web interface, and in the process create subdomain pages for each individual one.

I'm new at this but I still find it very hard to believe that there's no easy way to do this.

Thoughts?

  • Just the button? Not a picture of the item and a description? – Stephen Ostermiller Oct 23 '18 at 11:36
  • @StephenOstermiller well, it's not actually fruit, although I will need to refer to the domain name a couple times... I don't understand why I've been told by several support staff from both the registrar and the webhost that what I want to do is impossible unless I manually enter/create 100 subdomains with 100 pages for my 100 source domains. The answer below sounds perfectly feasible (once I figure out how to code it) but the naysayers are still outnumbering... – ashleedawg Oct 23 '18 at 12:53
  • 3
    I agree with LeonidMew that it is do-able. Your web host (or the hosting software such as cPanel) may not allow you to point all the sites at one directory. It might be easier with a virtual private server (VPS) which would give you more control. – Stephen Ostermiller Oct 23 '18 at 13:00
3

First you need to point all domains to same folder. So any request will end at same script. Its different on own server, and rented hosting.
Detect domain from server variables, url on your preferred scripting language and do make changes to output depending on that.
Without scripting its not possible to do so by same file/script.

If you have problems with first step, for example hosting provider not allowing it, then you can copy same script to each site ftp, and do it after any changes to script again. Actually better to change hosting, to what allow domain aliases.]

In general: all domains are aliases for same server/site. Script on site detects which domain requested.

Update: If you have own ip address and (virtual) server, with web-server software configured to listed on given ip address for any domain name, you could setup unlimited domain names to be resolved to your server ip. Domain name requires parking, at same or other hosting company, no matter where.
Virtual server are cheap, but cost more then usual shared hosting.
Since you are new to web, search for virtual server company what configures and maintain everything for you, I mean web server software setup.

  • Alias = formerly known as Parked Domains, correct? – ashleedawg Oct 23 '18 at 12:43
  • 1
    A bit different. Parked makes possible to resolve domain name. Alias requires resolve able domain(parked at same company or other) and also assigned to shared hosting site in config. So, you need both, alias accepted by hosting and parked domain. All this about servers hosted many customers on same IP address, what requires own domain name(or few names) for each customer. There are another case when you rent own ip address and virtual or real server. I'll add it to answer in few minutes. – LeonidMew Oct 23 '18 at 12:59
  • to confirm, the address bar will show the domain the user entered; it woudn't change in this case, correct? – ashleedawg Oct 23 '18 at 13:29
  • Yes. Did you already buy hosting? If no, search for shared hosting company allowing multiple aliases(domains) for same site. Shared hosting low limited for cpu/memory site can use. Use it for simple website. If your site requires move resources power, consider rent cheap/or expensive virtual server with website software preconfigured. – LeonidMew Oct 23 '18 at 13:36
  • @ashleedawg Funny - I have create domain alias at the same time while answered this question. Hosting service what I use allow add domains(and parking it) as stand-alone websites as well as aliases to existing sites in my account. I wish to consider it to you, but its Russian hosting company, servers are in Moscow so this bad idea(and probably off-topic?). And use of this domain will be similar to yours, change something in page depending on domain name, but only one domain. – LeonidMew Oct 23 '18 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.