首页 > 解决方案 > Redirect to an url but showing a different url in the bar adress using tomcat

问题描述

When the website is full, I redirect the users to a try_later_page.html, and told them to try after a few moment, But I want in that instant, that the adresse bar to contain mysite.com, and not the url mysite.com/try_later_page.html, so when the user try an F5 he will be send to the index page,

How can I do this ?

标签: javaapachetomcatservletshttp-redirect

解决方案


您必须使用 aforward而不是 a redirect。转发是服务器实习生并重新路由到新内容。浏览器对此重新路由一无所知,并停留在以前的 url 上。所以当用户F5在浏览器内使用时,我们会再次调用之前的站点(不是目标站点forward)。


推荐阅读