When the portal receives a request for a page using a friendly url the portal will need to obtain the layout the friendly url is refering to. At this point the locale doesn't matter because we don't allow same friendly url for different pages (we only allow it for the same layout in different locales, but same layout)
Once we have the layout, we have the following possibilities:
1. The friendly URL in the request matches the locale. At this point we don't have to do anything special, just show the layout.
2. The friendly URL in the request doesn't match the locale. Then, locale has more priority, so the portal will find the friendly url associated with that locale and will redirect the user to the same page using the valid friendly url that matches the locale.
(in both cases the locale will be obtained following the existing rules provided by Liferay to determine the locale for the request: see Languages and Time Zones section in portal.properties file)
So, imagine the following scenario where we have the following friendly urls and locales:
- Spanish /casa (Default Locale of the portal)
- English /home
- French /maison
1. A user whose locale setting is set to French, if he receives a url to the page /casa, portal will automatically redirect the user to /maison
2. A user whose locale is set to Italian, if he receives a url to the page /maison he will be automatically redirected to the page /casa (as we don't have italian localization we use the default one)
3. A user receives a url to /en/casa he will be automatically redirected to /en/home (locale has more priority and we redirect the user to the right friendly url considering the locale)