In my project built with Next.js, I am facing a challenge where I need to set up a redirect for URLs containing the character "#" symbol.
For instance, when a user visits /contact#support, I want it to automatically redirect to /contact-us/support
First Attempt:
{
"source": "/contact#support",
"destination": "/contact-us/support",
"permanent": true
},
Second Attempt: trying to use regex matching
{
"source": "/:slug(^contact#support$)",
"destination": "/contact-us/support",
"permanent": true
},
I'm not certain if this type of setup is feasible. I've searched through various forums but have not found any discussions addressing this specific scenario.