Fórum
Liferay 301 redirect
Marwen Abid, modificado 12 Anos atrás.
Liferay 301 redirect
New Member Postagens: 3 Data de Entrada: 13/03/12 Postagens Recentes
Hello guys,
I'm trying to redirect to a different page using the following code
But this uses a temporary 302 redirection. I need the liferay function sendRedirect to use the permanent 301 redirection. I tried the following but it's not working as well :
Any ideas ? I'm using Liferay 6.1 and Tomcat 7.
Thanks.
I'm trying to redirect to a different page using the following code
response.sendRedirect(newURL);
But this uses a temporary 302 redirection. I need the liferay function sendRedirect to use the permanent 301 redirection. I tried the following but it's not working as well :
response.setProperty(ResourceResponse.HTTP_STATUS_CODE, Integer.toString(301));
response.sendRedirect(newURL);
Any ideas ? I'm using Liferay 6.1 and Tomcat 7.
Thanks.
sridhar iyer, modificado 11 Anos atrás.
RE: Liferay 301 redirect (Resposta)
Junior Member Postagens: 57 Data de Entrada: 27/02/09 Postagens Recentes
You may try something like that
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>
Aravinth Kumar, modificado 6 Anos atrás.
RE: Liferay 301 redirect
Regular Member Postagens: 152 Data de Entrada: 26/06/13 Postagens Recentes
Hi,
I am using liferay 7. Is there any other way to do this in recent versions ?
Thanks in Advance.
Regards,
Aravinth
I am using liferay 7. Is there any other way to do this in recent versions ?
Thanks in Advance.
Regards,
Aravinth