0

Consider the following two URLs:

  1. https://www.google.com/search?q=foo
  2. https://www.google.com/search%3Fq%3Dfoo

To my knowledge, the second one is the percent-encoded version of the first one, but it returns an error. Why?

Aren't these two URLs technically equivalent as per RFC-3986? Could / should a web server choose to make them equivalent or would that go against the standard?

Community
  • 1
  • 1
Josh
  • 11,979
  • 17
  • 60
  • 96

1 Answers1

1

No, they are not. The question mark, when escaped, will lose the special meaning it has otherwise.

Julian Reschke
  • 40,156
  • 8
  • 95
  • 98
  • Thanks @Julian. I wonder, is that dependent on the web server, and how it may be configured? Or is this something that is actually to work the way you said, i.e. fairly universal so the escaping would truly avoid any alternative interpretation of the URL? – Josh Jun 09 '20 at 15:45