URL modifications

  1. The language is set from content
  2. The language is set from the code in the URL
  3. The language is set from the directory name in pretty permalinks
  4. Subdomains name and domains
  5. Hide URL language information for default language
  6. /language/ in pretty permalinks
  7. The front page url contains the language code instead of the page name or page id

Go in Languages > Settings

url-modifications-module

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.

diagram

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.

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/