The URLs of my website are www.example.com/?id=THEPRODUCTID#i where THEPRODUCTID is an alphanumeric string. Please note that #i is present at the end.
The problem is that Google crawlers are ignoring the #i specified on Sitemap.xml, so the results I can see on Google are www.example.com/?id=THEPRODUCTID.
As a quick solution, I want to create a servlet that redirects www.example.com/?id=THEPRODUCTID to www.example.com/?id=THEPRODUCTID#i. I am not sure how to do the mapping, or if it should be a filter, redirect, forward,... any guidance is very much appreciated.