- The language is set from content
- The language is set from the code in the URL
- The language is set from the directory name in pretty permalinks
- Subdomains name and domains
- Hide URL language information for default language
- /language/ in pretty permalinks
- The front page url contains the language code instead of the page name or page id
Go in Languages > Settings
1. The language is set from content
❶ The URL is not modified: whether Polylang is activated or not, the URL stays the same for posts, pages, categories and post tags. However the URL for the date and the author archives are modified to include the language code. It is indeed necessary to differentiate (for example) English monthly archives from German monthly archives.
2. The language is set from the code in the URL
❷ This option is checked by default if your Permalinks settings are set to Default.
For a site in English and in French, your posts URLs would look like:
• http://www.yoursite.com/?lang=en&p=2
• http://www.yoursite.com/?lang=fr&p=3
Compared to the option ❶, there are less compatibility risks with third party plugins and themes. This is due to the fact that in the case ❶, Polylang defers the language definition compared to the other cases a explained in the diagram below.
3. The language is set from the directory name in pretty permalinks
❸ This option is checked by default if your Permalinks settings are set to pretty permalinks. In most cases, you should keep this option as is, unless you know what you are doing. For a site in English and in French, your posts URLs would look like:
• http://www.yoursite.com/en/my-post/
• http://www.yoursite.com/fr/mon-article/
Note that, except with the first option which keeps as much URLs as possible, when Polylang is de-activated, every URL loose the language information and thus all external links are broken.
4. Subdomains name and domains
❹❺ For advanced users, it is possible to use subdomains (or a different domain per language). All your subdomains (or domains) must point to the same directory (where the WordPress index.php is present). Polylang checks if your domains or subdomains are correctly accessible. Otherwise, Polylang returns an error message. Contact your host provider to get the documentation for the subdomains and domains installation.
Note: we know that the interface of some host providers does not allow to choose the directory where a subdomain is pointing. Check with your host provider if it offers this possibility.
5. Hide URL language information for default language
❻ This option allows you to hide the language information only for the default language. In this case the monthly archives URL in the default language will look
like:
• http://www.yoursite.com/2015/03/
This option is very useful if you install Polylang on an existing website as none of your existing URLs in the default language are modified.
6. /language/ in pretty permalinks
❼ Here you can choose to include the keyword «language» in your URLs.
Keep /language/ in pretty permalinks: the monthly archives URL will look like:
• http://www.yoursite.com/language/en/2015/03/
Remove /language/ in pretty permalinks: the monthly archives URL will look like:
• http://www.yoursite.com/en/2015/03/
7. The front page url contains the language code instead of the page name or page id
❽ This option is available only if you chosen to display the front page as a static page in Settings > Reading. For a site in English and in French, the URLs of your home pages would look like:
• http://www.yoursite.com/en/
• http://www.yoursite.com/fr/
instead of
• http://www.yoursite.com/en/home/
• http://www.yoursite.com/fr/home-fr/
If English is your default language, you can even hide this language code /en/ by checking the option ❻. When both options ❻ and ❽ are checked, the URLs of your home pages look like:
• http://www.yoursite.com/
• http://www.yoursite.com/fr/