What is the correct syntax for appending a query string parameter when I’m currently at the “root” of my site?
1) http://www.example.com/?foo=bar
2) http://www.example.com?foo=bar
3) http://www.example.com/&foo=bar
I’m certain #3 is completely wrong, but I’m unsure about 1 or 2. I’ve never come across this scenario, it’s always been appended to a filename with it’s extension — this odd use case came up on our team and I was left scratching my head.
Number one is the only correct one. See RFC1738 3.3: