Netlify.toml redirects not working

Hey! Thanks for the ping @AaronP and thank you @Rnhj for your patience :slight_smile:!

Håndværk i top kvalitet should redirect to Håndværk i top kvalitet

The syntax for this, in a _redirects file, would look as follows:

/ url=bybarner.dk id=1184 /booking 301!

A few things to consider:

  • Because there is a page at Håndværk i top kvalitet (i.e. it responds with a 200 and not a 404) you’ll want to shadow your rule (301!)
  • Recent changes to how query string parameters are handled will mean that the query string parameters are automatically passed through to the new URL. Therefore, your users will actually end up at /booking?url=bybarner.dk&?id=1184. If you don’t want this to happen, you can follow the steps under Query String Parameters in this guide to append a ‘dummy’ parameter. Therefore, your rule would look something like:

/ url=bybarner.dk id=1184 /booking?no-query-string 301!

You could replace no-query-string with anything you like: redir might look cleaner, for example.

1 Like