views:

579

answers:

5

FOR SEARCH ENGINE OPTIMIZATION PURPOSES, does the location of the slug within a URL matter?

There's no doubt that you could code URL slugs to work properly in any order. I'm more interested to know if search engines place different weights to portions of the URL on the right-hand-side vs the left-hand-side

For example, here the slug appears at the end of the URL: http://stackoverflow.com/questions/47427/why-do-some-websites-add-slugs-to-the-end-of-urls

Whereas here the slug appears in the middle of the URL: http://stackoverflow.com/questions/why-do-some-websites-add-slugs-to-the-end-of-urls/47427

+2  A: 

Parsing the URL is probably a lot easier if the slug is at the end. You can pull out the values you need from the beginning of the path, and then just ignore everything after it. (so the slug could be even more complex than what you have, with multiple "directories", etc). If you put the slug at the beginning or the middle you have to be able to parse that out in order to find what's important.

Herms
Apparently it's not how it's done in StackOverflow
vartec
What do you mean? Using the links in the question, the first one (slug at the end) works. The second gives me page not found errors. So it looks to me like on SO the slug has to be at the end.
Herms
I'd disagree with this. Strings are usually parsed from left to right anyhow and people are more likely to add things to the end of a URL ( accidentally )
Atømix
@Atomiton Right, it's parsed left-to-right and people might accidentally add stuff to the end, so wouldn't that suggest the slug (which isn't parsed or really important) should go at the end, as I said?
Herms
@Herms. Sorry. Must've had a momentary brain fart. What you wrote is what I was thinking... ( but I admit I had to re-read it thrice to see that )
Atømix
+7  A: 

It's better to push whatever has less semantic content to the right because it's more likely to get chopped off by length limits on what's considered relevant. So the second form you post would be better for SEO purposes than the way SO does it. (Better yet is using the slug as a real identifier and keeping semantic-content-free IDs out of it.)

chaos
I agree with this. If you remove the slug from SO links, it doesn't make a difference
alex
@alex, I think what @chaos is saying is to remove the numeric identifier if possible in favor of only using the slug in the URL
Shawn Miller
People make mistakes. Sometimes they don't get the whole link. They can usually figure it out if they miss the beginning... but in this case, if they mess up the END and miss a number or add an extra one, the link is broken. having the "useless" slug at the end avoids this.
Atømix
A: 

http://stackoverflow.com/questions/727281/blahblablah-lets-assume-that-this-continues-on-and-on-and-on

Now if you truncate that http://stackoverflow.com/questions/727281/blahbla still works.

In the other case: http://stackoverflow.com/questions/why-do-some-websites-add-slugs-to-the-end-of-urls/47427 truncated http://stackoverflow.com/questions/why-do-so would have no chance to work.

BTW. StackOverflow is strange http://stackoverflow.com/questions/727281/bla... gives blank page, http://stackoverflow.com/questions/727281/bla. gives internal 404 page which is different from StackOverflow's 404 page.

vartec
Will it? Try the link :)
chaos
ASP.NET is weird ;-)
vartec
There's no doubt that you could code this to work properly in any order. I'm more interested to know if search engines place any different weight to portions of the URL on the right-hand-side vs the left-hand-side
Shawn Miller
+2  A: 

I always go with the Rule that it is important to move from right to left when determining the most important information in your URL for the user (an actual user or google). So the question you have to ask your self, is do you want your user to see the ID or the title as the most important thing of the page.

Also what happens if they drop off the number, and just leave the title. The page blows up right, but what happens if you drop the slug and leave the number. The page functions as normal.

Nick Berardi
+3  A: 

Unfortunately, given Google's (and most other search engine's) security through obscurity (fear of gaming of the system if any clear methods are described/explained), there's just not going to be a clear, demonstrable answer.

On the whole, you can assume that if it seems slimy, Google will penalize it, and if it seems semantic/useful, Google will promote it. In the case of the above url, it's my guess that Google will treat both the same, but that's entirely a guess, and outside of a Google algorithmic engineer stopping in here, I doubt you're going to find anything more definitive.

davebug