掲示板

Liferay 301 redirect

12年前 に Marwen Abid によって更新されました。

Liferay 301 redirect

New Member 投稿: 3 参加年月日: 12/03/13 最新の投稿
Hello guys,

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.
thumbnail
11年前 に sridhar iyer によって更新されました。

RE: Liferay 301 redirect (回答)

Junior Member 投稿: 57 参加年月日: 09/02/27 最新の投稿
You may try something like that

<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>
thumbnail
6年前 に Aravinth Kumar によって更新されました。

RE: Liferay 301 redirect

Regular Member 投稿: 152 参加年月日: 13/06/26 最新の投稿
Hi,
I am using liferay 7. Is there any other way to do this in recent versions ?

Thanks in Advance.

Regards,
Aravinth