- We have a page where we want to use the same friendly URL for different translations, but when we try to save the page, it fails with an error:
- Please enter a unique friendly URL.
- We understand that the behavior was made by design for SEO purposes, however, we would prefer to use our method, where we have the same URL with different locale prefixes, is that possible?
- Liferay DXP 7.3+
- The behavior is intended, however, there is a workaround that might help you if you want to use the same friendly URL in your default language and one of the translations, or if you have a two-language environment. That means you won't be able to do this with two translations.
- The trick is that if you leave a translation's friendly URL empty, it will be populated with the default language's friendly URL.
Please check the below steps (English was the site's default language in this case and we used the
locale.prepend.friendly.url.style=2property, where the language key was always displayed in the URL):
- Create a page, name it Marketing-news (page name and friendly URL will be Marketing-news)
- Add a German translation, name it German, and save without adding the friendly URL
- Open the page with a user with English language set -> we had the http://localhost:8080/en/marketing-news URL
- Then switch to German either by setting it in the user's account settings or just changing the language key from en to de in the URL -> http://localhost:8080/de/marketing-news
Contenido exclusivo para suscriptores.
Una Suscripción Enterprise de Liferay proporciona acceso a más de 1.500 artículos que incluyen las mejores practicas, diagnóstico de problemas y otras soluciones útiles. Inicia sesión para tener un acceso completo.Inicia sesión