Redirects containing whitespaces or %20

Hey community,

We are about to complete a JAMStack (Gatsby / Sanity) rebuild of an old bespoke website built on php. The website is a recipe site that contains over 400 recipes. We are currently implementing the technical SEO phase and are running into issues creating redirects from the old URLs that are terribly formatted and contain multiple white spaces.

We have tried using the createRedirect function inside of the gatsby-node.js and have also tried using the Netlify _redirects file. The redirect validator on Netlify passes all the URLs as valid, however, when navigating to the site the redirect fails.

An example of a redirect passing validation but failing to work is: /shop/BARBEQUE/Beef%20Satays?mv_pc=11555 /recipes/beef-satays 301

My question is, can Netlify redirects accept %20s? And if not, is there a way I could use Netlify Edge Headers, similar to the rewrite engine on apache, to change the %20 into something more readable and then create my redirects from that?

Thanks in advanced,

Hey there! I’ve seen your Helpdesk ticket and responded accordingly.

For posterity, I believe the issue here is the query string parameter syntax. Your to path should/could read as follows:

/shop/BARBEQUE/Beef%20Satays mv_pc=:value