Documentation: Domain per Language plugin
How it works
Domain per Language sits between the domain a visitor arrives on and Joomla's own language routing. This article explains what it does with a page request, with a link, and with the tags that search engines read.
The domain decides the language
When someone arrives on a domain you configured, the plugin sets the language of that page before Joomla's language filter gets its turn.
That order matters. Without it, Joomla would pick the language from a cookie, from the session or from the browser. Someone who once clicked Dutch would then keep seeing Dutch on your English domain.
A page in the language of that domain is shown without its language code. A language that has no domain of its own keeps its code and lives on the domain of your default language.
Redirects
All of these are permanent redirects, also called a 301. A 301 tells browsers and search engines that the new address is the real one from now on. None of them happen while a form is being sent in, so nothing a visitor typed ever gets lost.
- On the English domain,
www.example.com/en/aboutbecomeswww.example.com/about. The language code of the domain's own language would only create a second address for the same page. - A page in another language moves to that language's domain, so
www.example.com/nl/over-onsbecomeswww.example.nl/over-ons. - The www or the non-www version of a domain you configured moves to the one you typed in. The path and everything after the question mark stay the same.
A host that is not in your list is left alone completely. Your staging domain, localhost or an IP address keeps behaving like a normal multilingual Joomla site, language codes and all.
Links between the domains
Joomla builds its links with its own router, and that router always keeps the domain of the page you are on. So a link to another language comes out of the router with a small marker in its path instead of the other domain.
The plugin swaps that marker for the real address just before the page is sent to the visitor. You never see the marker. What you get is https://www.example.nl/over-ons in your menu, in the language switcher, in the hreflang tags and in your feeds.
Three layers make sure a marker never reaches a visitor: the rewrite of the finished page, a redirect for a marker address that gets opened anyway (from an e-mail a scheduled task sent, for example), and a method that other extensions can call. See the article about links in other extensions.
hreflang, x-default and the canonical
hreflang tags tell a search engine which page is the same page in another language. The language filter adds them and this plugin rewrites them to the right domain. The x-default tag, which points at the page for everybody else, is rewritten too. Search engines get one clean set of addresses per page.
The core System - SEF plugin has a field called Site Domain. When it is filled in, that plugin puts the canonical of every page on that one domain. A canonical says "this is the real address of this page", so that is wrong as soon as a page lives on another language domain. Domain per Language moves such a canonical back to the domain of the page's own language. Only the domain part changes, the rest of the address stays untouched. On a host that is not in your list, the SEF plugin keeps doing its own thing.
Caching
The plugin finishes its work before Joomla stores a page in the cache. A cached page therefore already carries the right addresses. Joomla caches per full address, domain included, so every domain gets its own cached copies.