1

I have to create a website for a client. This client sells different products, and wants to enhance their view. The best way I thought about was to create subdomains, for example product1.domain.com, product2.domain.com, etc..

The site domain.com will show all the products (accessible by the menu for example), and the subdomains will only show the specific product. All the content will be the same (homepage, contact, about, except the products) on both domain and subdomains. Subdirectories aren't a good solution for my client because the products are rivals and domain.com/product1/ doesn't seem as good as subdomains.

I've tried wordpress multisite but I realised that each subdomain was completely separated, and it's not what I want. I've seen that some websites have subdomains for multi langages like gravatar.com or wikipedia.org, and that a plugin exists for that (WPML), but I don't know how it works. How I can do it ? I'm a bit lost. Do I need to create a plugin to use it within wordpress multisite (I've never done that before) or can I do it without WPMU ? I can code in php.

Any help/advice/clue is welcome

1 Answer 1

0

Yes, multisite is not what you need here. I would try to map all subdomains on the same wordpress install, and then customize the template via the current URL. In the wp-config.php you then use the current URL as base url:

define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']); 
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);

You can also do different themes per subdomain (see plugins for "theme switcher").

1
  • It is too simple.. and it works ! Thank you so much, I was searching too far ^^
    – Sovnfield
    Jun 30, 2015 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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