Issue
-
A static page in Liferay has been built with the following property to portal-ext.properties.
layout.friendly.url.page.not.found=/web/error/error404
Hit the URL: https://xyz/web/error/error404 (just for demonstration purposes here)
The Liferay resource not found error page will be visible, along with the search bar and the sign-in portlet.
Expected Behavior: The application should route to the error page after hitting this URL.
Environment
- Liferay DXP 7.4
Resolution
-
To avoid conflicts with this, be sure to specify both properties for the error page:
layout.friendly.url.page.not.found
andsites.friendly.url.page.not.found
both to /web/error/error404 in the portal-ext.properties file.- Any URL that contains /web will redirect to a public site if it exists, or an error page if the site does not exist. A friendlyURL for a specific page would be /web/<groupFriendlyURL>/<pageFriendlyURL>.
Additional Information
-
To test this use case, the value can be the same as
layout.friendly.url.page.not.found
. Thus, the following are steps that can be taken in vanilla instance:
- Start Liferay with a fresh database.
- Go to Control Panel > Sites
- Create a new site named error
- Create a web content named 404
- In the new error site, Go to Site Builder > Pages > create a page titled error404.
- Configure
friendlyURL
of the error404 page to be /error404 - Place a web content display on your error404 page and select your 404 content.
- Shutdown the portal and set the
layout.friendly.url.page.not.found
andsites.friendly.url.page.not.found
both to /web/error/error404 in portal-ext.properties - Restart Liferay
- Type any random url after localhost:8080 and notice users are redirected to the error404 page with your web content.
Conteúdo Excluesivo para Assinantes
Uma Subscrição do Liferay Enterprise fornece acesso a mais de 1.500 artigos que incluem práticas recomendadas, solução de problemas e outras soluções valiosas. Faça login para obter acesso completo.
Entrar