Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top