Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


Best practice for a multi country Joomla Site

Best practice for a multi country Joomla Site


Im considering to buy Chameleon and was wondering what is the best practice to create a multi country site with Joomla for example
- www.sitename.com/united-states
- www.sitename.com/singapore

I have two options:
- Code an index.php to route to duplicates of a site but with country relevant content
- Use chameleon, however no idea how it would be able to do the above.. or is there a better way


Beginner Modder
1 Posts
Administrator has disabled public posting

Re: Best practice for a multi country Joomla Site

Hi chizuoka,

That's a great question. Chameleon can help you to achieve lots of different scenarios, and most of them better than setting up different index.php files or separate Joomla installations. But the choice of approach is important.

Here are some ideas:

1 - subdomains. e.g. usa.sitename.com, singapore.sitename.com

These all route to the same Joomla installation (IP address) via Parked Domains in cPanel-speak.

Chameleon can use the name of the subdomain chosen, as part of the condition in any rule. So that can be used to trigger a separate template, switch on/off plugins, remove menu items, add JS/CSS, do dynamic search-replace on the pages. etc.

The best thing about this approach is that it's always completely unambiguous about what section of the site (subdomain) the user is on. The only thing that can trip this up is if you have some component on your site that insists on creating full URLs including the domain name, and this domain name is set up in the component's preferences. In that case you can find the site suddenly switching over to the "wrong" domain. I think core Joomla doesn't have this problem though.

2 - Use the menu structure to govern the different parts of the site.

e.g. mysite.com/usa: you have a menu item called /usa and all the pages relevant to this are "below" /usa in the menu structure. Same with /singapore etc.

Chameleon can detect that you are in one of these menu items via 2 different means: (i) because they are "below" /usa in the menu structure, or (ii) because the file path in the URL starts with "/usa".

The down-side of this approach is that if a given article is linked to from 2 different menu items, then if there is a link to that article from somewhere else on a page, then Joomla will sometimes be forced to choose which URL to use to reach that article. Sometimes this can be the "wrong" one. Chameleon would not be able to help you there, and the users could easily end up on the "wrong" site.

(3) I have used this approach once and it worked... you can create a soft-link in your htdocs directory that links back to the main directory. e.g. /home/mysite/htdocs/usa can be a soft link (ln -s) to /home/mysite/htdocs.

If you do it that way, then as far as the server is concerned (and Joomla is concerned) there's a whole different Joomla installation set up at /usa but it's an exact duplicate of the main one.

What you can do then is use Chameleon to detect /usa/ at the start of the URL and use that to manipulate anything you need to do (see list above). The advantage of doing it this way is that as long as the user is within /usa, Joomla will treat /usa/ as the home page, so there's much less (hopefully 0%) chance that Joomla will ever throw the user back to "/" for any reason.

It's possible with this approach that you could still have troubles with any components that insist on creating full URLs using a fixed path, but at least this way the domain name itself is consistent across the different subsites.

Suggestions regarding "country relevant content":

  • you can assign modules to different menu items/pages, so depending on how you have structured your menus it's probably easy to make the modules reflect the site you are on. If you use approach 1 (subdomains) then it would be good to use MetaMod to control the visibility of modules based on domain name.
  • you can set up variations (styles) of the same basic template using the template manager, e.g. with different logos, strap-lines, colours etc, then use Chameleon to select the template based on whatever criteria you are using to distinguish the different parts of the site
  • with the different template styles, many templates will allow you to select a particular menu to use as the "main menu" on the page. So the choice of template (governed by Chameleon, which is governed by your site criteria) then determines which menu to display. So you can set up completely different menu structures for each country.
  • on the other hand there are probably some menus that you want to be shared amongst the different countries, except with some differences. e.g. the "contact us" might need to point to a different Contact for the different countries, but all other items in that menu might be fine to be shared. In this case, Chameleon can "hide" menu items based on your site criteria. So if it detects the visitor is on the USA site it could hide the Singapore menu item, and vice versa. To set this up, you just put the 2 Contact Us items next to each other in the menu, but rely on Chameleon to turn one or the other of them OFF.
  • Chameleon can also toggle which menu item is the "home page" (aka default page), i.e. the one that appears on "/". So if you want a very different home page for each country, then just set up different menu items for each one, and Chameleon can sort that out for you.

I hope this gives you some ideas. I'm not completely sure what "best practice" is in this case, as it might also depend on your industry and customers, as well as how your brand is to be portrayed around the world.


Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Posts this week:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky