Fórumok

Page redirection on error (403)

thumbnail
Puneet Upadhyay, módosítva 11 év-val korábban

Page redirection on error (403)

Regular Member Bejegyzések: 234 Csatlakozás dátuma: 2011.10.22. Legújabb bejegyzések
Hi all,

please let me know how i can handle (redirect to page on) 403 error on some specific keywords which are used as url.

For example:-
http://localhost:8080/documents/

in this "documents" is a keyword
thumbnail
Mazhar Alam, módosítva 11 év-val korábban

RE: Page redirection on error (403)

Regular Member Bejegyzések: 191 Csatlakozás dátuma: 2011.11.25. Legújabb bejegyzések
Hi,
Im also looking into this, in order to develop a general error page and if someone plays with url he should be redirected to the general error..
Do inform me if you found anything in it..
thumbnail
Gnaniyar Zubair, módosítva 9 év-val korábban

RE: Page redirection on error (403)

Liferay Master Bejegyzések: 722 Csatlakozás dátuma: 2007.12.19. Legújabb bejegyzések
I have tried now, it is not redirecting to our custom error page. I have customized html/portal/status.jsp if any errors occurs. Other Permission Errors and No Such Resource errors redirecting to status.jsp But 403 Error it is not capturing.

I have developed new hook for URL Filter and redirecting if it is not a secure URl. But I couldn;t catch the 403 Error? any idea?
thumbnail
chandan B, módosítva 9 év-val korábban

RE: Page redirection on error (403)

Junior Member Bejegyzések: 64 Csatlakozás dátuma: 2014.08.06. Legújabb bejegyzések
It would be to set up a custom error document for 403 errors in Apache, and point this at a script to handle the error. Refer to the error document documentation on how to do this. emoticonemoticonemoticonemoticon
thumbnail
prabhakar reddy, módosítva 9 év-val korábban

RE: Page redirection on error (403)

New Member Bejegyzések: 7 Csatlakozás dátuma: 2013.08.01. Legújabb bejegyzések
Hi All,

For configure the custom error page for 403(forbidden error), we need to write a liferay hook.

/html/portal/status.jsp in side this jsp page we have code like this. Now we can write our custom message here.

<c:when test="<%= SessionErrors.contains(request, PrincipalException.class.getName()) %>">
<h3 class="alert alert-error">
<liferay-ui:message key="forbidden" />
</h3>

<liferay-ui:message key="you-do-not-have-permission-to-access-the-requested-resource" />

<br /><br />

<code class="lfr-url-error"><%= HtmlUtil.escape(url) %></code>
</c:when>



Thanks,
Prabhakar reddy.