开发者

301 Redirects in JSP

I am using 301 redirect to redirect my old website pages to the new site. The code for it as follows:

<%
response.setStatus(301);
response.setHeader( "Location", "http://my_new_website/page.html" );
response.setHeader( "Connection", "close" );
%>

So, whenever user reaches the old page, i开发者_Python百科t will be automatically redirected to the new site page: http://my_new_website/page.html

Now I need a option like, during redirect from the old page to the new website, it must display an message something like "The website is moved" for a while and then automatically redirected the new website.

What should I do for this? Can anyone suggest a way for it?


Alternatively, you could immediately redirect your user to the new site and check the referrer - if it is the old site, you could then present your user a message like "You have been redirected here because...".


You want something like meta refresh, I think.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜