Baron Munchausen’s Crawl Test Lab

URL With Spaces Example: What Crawlers Do

My route to St. Petersburg includes a fortnight, a Capital letter, and a double slash where the ice broke under the wolf.

The short answer

What it is
A URL with spaces has a blank character in its path, either raw or encoded as %20. A raw space is not valid in a URL at all, so software has to guess or repair it.
Why it matters
Different tools repair spaces in different ways, so one page can end up with several addresses. A shared link can also break at the space.
How a crawler should report it
Report a URL format warning that names the cause, such as space in path, and show the source page and the link as written. Group it with other format faults like uppercase letters, underscores, double slashes, and repeated segments.
Live examples
The front and back halves of the Baron's horse, each going about its business.
Fig. 4. A gap in the middle, encoded as %20.

What Happens to a Space Inside a Web Address

A URL with spaces breaks a basic rule of the URL standard. A space is not an allowed character, so it must be encoded. In a path, the encoded form is %20. In a query string sent by a form, a space often becomes a plus sign. Spaces usually arrive from file names, such as a PDF called Annual Report.pdf uploaded straight to a server. Page titles turned into paths by a bad script do the same thing.

Browsers are forgiving. If you type or click a link with a space, the browser converts it to %20 and sends the request. Markup can trip this up, though. In an unquoted attribute such as href=/my page/, the space ends the value, so the link goes to /my. Chat apps and email clients often stop a link at the first space too. The reader then lands on the wrong page.

Search engines can crawl encoded URLs, and %20 does work. But it is ugly and easy to break. The address can appear as %20 in one place, a plus sign in another, and a raw space in a third. Those may count as separate URLs. Google's own advice is to use hyphens between words, since they are simple and easy to read.

To detect the issue, scan every link and URL in your crawl for a raw space or %20 in the path. Check your sitemaps and file uploads as well. Other format faults often show up next to it, such as double slashes or too many query parameters. To fix it, rename the page or file with lowercase words and hyphens. Add a 301 redirect from the old address. Then update the links. Clean file names on upload so that the problem can't come back.