View Full Version : URL's with spaces in variable values

10-16-2003, 11:29 AM
How do the search engines handle spaces in urls?

for example take the following URL:

http://www.domain.com/search.php?val=blue bottle

It actually comes out as:


Now, I'm trying to use search engine friendly URLs. So, would the following be "search engine friendly"?


Or does the space character (I guess the search engine would actually see a space and not %20?) matter?

10-16-2003, 11:30 AM
Just looking at my post, it seems like it will be a problem ;)

10-16-2003, 12:31 PM
I think there's an article on this somewhere...

I'll have a look.

10-16-2003, 12:36 PM
I've read the one about search engine friendly URL's on this site, which you may be thinking of. But I haven't seen anything about spaces in the URL. If you do find anything though, I'd appreciate it :)

10-16-2003, 12:39 PM
Hmmm...Can't find it. Sure I've read one though.

Anyway, from what I've heard it's bad for you to do that - and better to use dash or underscore.

I'm sure Chris will be able to confirm that, or say different though.

10-16-2003, 12:45 PM
Yeh, I'm pretty certain that it's not a good idea. Just wanted to make sure before I add the code to replace a space character with an underscore on one page and then have it taken away again on the resulting page. I'm trying to keep things as simple as possible :)

10-16-2003, 01:30 PM
URLs with urlencoded spaces work, but you're better off not using them.

10-16-2003, 01:35 PM
If I was to replace them, would it be better to use a hyphen or an undersocre?

10-16-2003, 04:04 PM