Post

Well, TIL. I would have assumed they're equivalent, but they're NOT. This was a fun side-track. "?filter[]=123" ≠ "?filter%5B%5D=123" because in RFC 3986, Section 2.2 the characters brackets ([, ]) and plus signs (+) are defined as part of the reserved set.

"URIs that differ in the replacement of a reserved character with its corresponding percent-encoded octet are not equivalent. Percent-encoding a reserved character, or decoding a percent-encoded octet that corresponds to a reserved character, will change how the URI is interpreted by ...

0 reposts0 likes

... most applications. Thus, characters in the reserved set are protected from normalization..." — IETF STD 66 / RFC 3986, Section 2.2

JavaScript can even check for this: new URL('https://example.com/category?filter[]=123').href === new URL('https://example.com/category?filter%5B%5D=123').href // Output: false

That said, *maybe* your server makes them "soft-equivalent" by serving the same content. We'd crawl both versions, if we see the same content (maybe even checksum level), we'd de-dupe them and pick one.

So in short, pick one, and use it consistently (links, canonical, sitemaps, structured data). The same is with " " (space), + (plus), and "%20", but with the bonus of this being different depending on which URL element it's in (path vs query string).