开发者

wicket sessions: how to prevent "jsessionid" from showing up in googlebot crawl results?

开发者 https://www.devze.com 2023-03-10 15:49 出处:网络
When google crawls our site the resulting URLs all have the jsessionid appended to them. Is this happening because the app server is detecting a lack of cookie support in Googlebot, forcing the sessi

When google crawls our site the resulting URLs all have the jsessionid appended to them. Is this happening because the app server is detecting a lack of cookie support in Googlebot, forcing the session to be maintained via URL-rewriting? Is there anything I can do about it?

开发者_如何学CIs the solution simply to never call Component.getSession() ? Is there anything like HttpServletRequest.getSession(false) ?

Edit: just found org.apache.wicket.Session.exists()


Found the solution in SEO - Search Engine Optimization - Apache Wicket Wiki.

In a nutshell:

  • override WebApplication.newWebResponse()
  • have it return a BufferedWebResponse that checks to see if the user-agent is a crawler (i.e. googlebot) or not
  • if it's a crawler, don't re-write the URL
0

精彩评论

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