RE: Unable to redirect Custom 404 page.

thumbnail
Jamie Sammons, modified 2 Years ago. New Member Posts: 10 Join Date: 2/13/16 Recent Posts

Hi,

I haveadded below property in portal-ext.properties file to redirect my Custom 404 page when the user access the invalid page/resource or site.

layout.friendly.url.page.not.found=/web/guest/404-error
sites.friendly.url.page.not.found=/web/guest/404-error

I am able to redirect to my custo 404 page whe the user accessed wrong page name or site. But i am unable to redirect to 404 page whe the user trying to access/download the document/resource, it is navigating to the defalut 404 error which is defined in html/potal/status.jsp. Refer below screen shots. Please suggest me is there any way to redirect to my custom 404 page when the user is accessing the document download link which is not exist without modifying the status.jsp.

 

Please suggest me a way.

thumbnail
Jamie Sammons, modified 2 Years ago. Expert Posts: 308 Join Date: 2/13/13 Recent Posts

Hi Sumanth, I don't know the answer but you might need to give us more information for someone to help.

1. What Liferay version are you referring to?

2. You referred to screenshots but I do not see any attached to your post.

3. If you know where the error message you'd like to override is defined, in a status.jsp, it will be helpful to link to the src code's specific relevant lines so someone can check it out really quickly.

I hope that helps.

thumbnail
Jamie Sammons, modified 2 Years ago. New Member Posts: 10 Join Date: 2/13/16 Recent Posts

Hi Russell, 

Thank you for your reply. The requirement is to show a custom 404 page (404 page is having a web content which is editable) to user when he accessed any invalid Layout URL and invalid resource which is not there in server or which is there inrecycle bin. The layout.friendly.url.page.not.found property is working fine for layout error but it is not working when the user is trying to access which is there in Recycle bin. The default status.jsp is rendering in this case. So without changing status.jsp we need to achive this. 

I have tried overriding the struts action for /portal/status path and there i have written some conditions. It is working fine as per our requirement.