Friday, September 11, 2015

Google On Spaces In Your URLs


John Mueller of Google posted a note about spaces in the URL on Google+. You know, the URLs that look like www.domain.com/file name goes here.html.


Should you fill those holes?

John Mueller of Google said "the answer is not "no"" when it comes to the question "Should you encode spaces in URLs as "%20", "+" or as a space (" ")?"

I love when he answers questions with double negatives, makes you scratch your head.

Here is the full post on Google+:

_____________________________________________________________________________

Should you encode spaces in URLs as "%20", "+" or as a space (" ")?


(the answer is not "no" :-)) I run into this question every now and then, maybe this will help someone get it right too :).
TL;DR: use "+" or "%20" in the query-string, use "%20" within the rest of the URL.
_____________________________________________________________________________

So in short, be safe, make sure your URLs do not have spaces in them. It is best to use hyphens, but you can close the holes with the + or "%20" but it is probably best to use hyphens.

0 comments:

Post a Comment