Hi all, I’m attempting to redirect from some legacy routes to a new routing scheme and having some trouble. Each system uses query strings, but the previous system used an ID based system while the new one is using slugs and a namespaced route. Here’s a few examples from my _redirects file:
Is this possible through Netlify redirects? I’m not seeing this functional on my deploy preview, at least. I’d welcome any direction or input here. Thanks!
After spending a good chunk of the day on this, I haven’t been able to make any progress. I’ll include my _redirects file in its entirety for clarity below as a Gist to save space here:
Here are a few of the other links that should be redirecting for which I’ve preserved my original approach - these all just wind up on the home page and don’t execute any redirects:
Hello @kpollich, it doesn’t look like your redirect rules are formatted correctly. As mentioned in our redirects doc, your redirect rule should look more like the following:
/ cat=:value /roster/category/:value
You won’t be able to create a redirect rule that checks the params like you are doing. You can only pass on the value of the param to the path you are redirecting to. In my example, if your root path had a param like /?cat=orchestras, it will get redirected to /roster/category/orchestras`.
That’s definitely a disappointment that I can’t implement the redirects based on query strings. I think I can potentially stitch something together with a redirect like you’re mentioning that forwards the request to a route which then handles processing the legacy query strings and redirecting further.