How do I make Liferay 6.1.0 always redirect to a 404 page when a resource isn't found?

戏子无情 提交于 2019-12-01 00:31:34

I was still struggling to figure out how to do this until I read the section in the Liferay Developer's Guide about "Overriding a JSP". That told me exactly what I needed to know. Where the 404.jsp file should be stored in my hook, why there was a .portal.jsp file appearing in my liferay installation, etc. One other critical thing that was not mentioned was the addition required to the portal-ext.properties file. I had to add the following:

# 404 page
layout.show.http.status=true
layout.friendly.url.page.not.found=/errors/404.jsp

After a server restart, the 404 page started displaying for all incorrect pages.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!