0

As Stack Overflow seems to be unable to create links from URLs that have spaces in them, copy and paste this URL into your browser.

http://grooveshark.com/#!/search/song?q=we will rock you

It does not redirect you to ...song?q=we%20will%20rock%20you or anything like that. The spaces just simply stay there. When I first saw this, it looked so foreign to me. How is this achieved?

UserIsCorrupt
  • 4,837
  • 15
  • 38
  • 41

2 Answers2

0

I believe they use javascript to set the contents of the url bar. You can use something like Live HTTP Headers to confirm that the browser definitely sends a request with %20 encoded spaces.

Owen
  • 1,726
  • 10
  • 15
0

It’s a browser setting. The browser decodes the URL, to make it more readable for humans.

If you copy the URL from the browser’s address bar and paste it into a text document, you’ll see that the space characters are percent-encoded.

See How can I see how the browser percent-encoded my URL? (which is not visible on address bar)

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360