Currently, I have a series of links that utilize #anchors to direct users to different sections within the same webpage. However, I am considering transitioning to a setup where each link corresponds to its own separate webpage. My goal is to ensure that the existing links continue to work by implementing redirects.
Original link format:
/all_products#A
/all_products#B
/all_products#C
New link format:
/products/A
/products/B
/products/C
While I am aware that the server does not receive the anchor name in the request, there may be a way to achieve this using JavaScript.
Is it feasible to automatically redirect from /all_products#A to /products/A through the use of JavaScript?
I believe utilizing jQuery for this purpose would be appropriate, as it is already integrated into the website.