Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Which url format/divider ranks better nowadays? hyphen or slash?

         

dirkules

2:30 pm on Jan 27, 2012 (gmt 0)

10+ Year Member



Which will rank better nowadays?
example.com/john-miller-cars-inc-438332
or
example.com/john-miller-cars-inc/438332

I'm speaking of millions of pages here. I see the guys at facebook doing the latter and I kinda think they know what they're doing.

On the other hand I mostly read the first one is the better one to stick with.

I'm afraid the first one looks more spammy than the second one when it comes to millions of pages, but then the second one is "one level deeper" from root ... what do you think?

Planet13

3:47 pm on Jan 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...but then the second one is "one level deeper" from root ... what do you think?


Don't worry about that part. Matt Cutts has said in several videos that doesn't matter at all.

what is more of a concern is HOW MANY CLICKS away from the home page your key pages are. You could have fifteen nested directories (so the page is fifteen folders deep), and if you link directly from the home page, it will have the same Page Rank as if it were in the root directory.

Hope this helps.

g1smd

4:08 pm on Jan 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'd put the unique reference number up front, makes for easier RewriteRules.

I'd generally not use the folder option.

One major design flaw that happens on many sites is that the number is used to pull the correct content from the database and the words in the URL are not ever verified as being correct for that page. This allows a duplicate content situation and opens the site up to malicious external linking.

Either verify the words and redirect to the correct URL if they are incorrect in any way or else return 404 for incorrect words.

dirkules

4:59 pm on Jan 27, 2012 (gmt 0)

10+ Year Member



Thank you guys!

Good to know it doesn't matter how deep the page is. Now that you have said that I think I saw the video, too! Still hard to believe that it doesn't matter at all..

I'd put the unique reference number up front, makes for easier RewriteRules.


Maybe I don't know enough about this, but I don't see where this makes easier RewriteRules.
RewriteRule ^(.*)-([0-9]+)$ /page.php?id=$2 [L,QSA]

I'll optimize the first part sometime, because it only contains letters, numbers and dashes.
And SEO wise: is it not better to have the numbers in the url as far in the end as possible?

Either verify the words and redirect to the correct URL if they are incorrect in any way or else return 404 for incorrect words.

Yeah I redirect it to the correct version and use the canonical tag anyway..


Again, thank you guys!

g1smd

5:15 pm on Jan 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Never use (.*) at the beginning or in the middle of a RegEx pattern.

If you do not validate the text in $1 in your script, I'll link to your flagship product using
example.com/overpriced-junk-will-make-your-hair-fall-out/4457226272/
or worse.

With numbers up front:
RewriteRule ^([0-9]+)-(.*) /page.php?id=$1&text=$2 [L,QSA]


but be really sure you want do want to re-append all of the original parameters.

dirkules

6:16 pm on Jan 27, 2012 (gmt 0)

10+ Year Member



Yes I understand and I was trying to explain in my previous post...

Yeah I redirect it to the correct version and use the canonical tag anyway..


you know what I mean by canonical tag I assume

g1smd

7:12 pm on Jan 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You should be safe with canonical tag or redirect.

The extra detail was provided for the thousands of other people that will read this page over the next few months. :)

dirkules

8:25 pm on Jan 27, 2012 (gmt 0)

10+ Year Member



Yeah, good thinking. One of the reasons why I love this forum. Such quick, comprehensive and competent info/replies. Definitely best for SEO!

g1smd

8:28 pm on Jan 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You're definitely a "lurker". Jeez... 5 posts in 3 years. LOL. :)

seoskunk

8:51 pm on Jan 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Which will rank better nowadays?
example.com/john-miller-cars-inc-438332
or
example.com/john-miller-cars-inc/438332


I think g1smd will rank just fine but I prefer

example.com/john-miller-cars-inc-438332

Because it indicates the full url to a web page and does not indicate folders

On a static site the slashes would indicate folders and you could see the index of the folder by going to the / part.

Anyway just a personal preference either will rank well

lucy24

10:21 pm on Jan 27, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you could see the index of the folder by going to the / part.

Only if there is one, or you've got auto-indexing enabled. But that's a different thread.

dirkules

9:35 pm on Jan 30, 2012 (gmt 0)

10+ Year Member



ok, i guess i'll stick with /john-miller-234903 then..

one more question about slashes: i have my search running on a subdomain like search.example.com/los-angeles-ca/john-miller (the dashes are removed internally for fulltext search)

i read it would be better SEO to put (force) a trailing slash in the url. i'm sure it won't make a very big difference, but i want to start out right with the best onsite seo as possible.
what are your thoughts on this?

fyi: pagination will be realized with an url parameter like search.example.com/los-angeles-ca/john-miller(/)?page=2345
...unless you say it's a no-go

g1smd

10:17 pm on Jan 30, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



URLs ending with a slash are defined as "folders" in the HTTP specs.

If it isn't a folder, don't add a trailing slash.

dirkules

10:33 pm on Jan 30, 2012 (gmt 0)

10+ Year Member



URLs ending with a slash are defined as "folders" in the HTTP specs.

If it isn't a folder, don't add a trailing slash.


Okay so you're saying don't look at what performs better in SEO and just stick with the specs? and really isn't that one of the great things about htaccess/rewrites?

and wouldn't i need a file extension like .html to meet the specs?

g1smd

10:55 pm on Jan 30, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



URLs for pages can be extensionless.

You need extensions for images and files like PDFs and so on.

dirkules

4:39 pm on Jan 31, 2012 (gmt 0)

10+ Year Member



ok, good to know, thanks g1smd!

and how about paging through the results like search.example.com/los-angeles-ca/john-miller?page=2345

is it good SEO practice? any recommendations?

enigma1

10:52 am on Feb 1, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Pagination in general is not good for SEO. Avoid it if possible at least for SEs. It increases content management because now you need to provide relevant titles for each page, meta-tags etc. Use filters to assist normal visitors to locate content.

Also

example.com/john-miller-cars-inc-438332
vs
example.com/john-miller-cars-inc

The last one is better for SEO. There is no point using identifiers with the URLs. The extra irrelevant numbers detriment links, they expose stuff surely you don't want others to know and make the links harder to manage.

dirkules

11:08 am on Feb 1, 2012 (gmt 0)

10+ Year Member



Well I understand the id in the url doesn't help SEO, but I am using an API where I need to know the id of the object being requested.

g1smd

8:12 pm on Feb 1, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Using an ID in the URL can make for simpler URL rewriting and better handling of malformed URL requests.

It's very easy to add a few lines of code to the PHP script to redirect a request for
example.com/427272-this-great-produ...src="
to the correct
www.example.com/427272-this-great-product
URL.

I prefer the ID be first so that truncated URL requests can still be correctly redirected. You can also change the page title and the URL will update and all requests for old versions of the URL will automatically be redirected to the new URL without any further effort.

dirkules

9:04 pm on Feb 1, 2012 (gmt 0)

10+ Year Member



g1smd: redirecting to the correct url is exactly what i do (that's what i meant on my first comment) and even if you don't redirect to the correct url, the canonical tag will make sure the url is listed correctly in G's SERPs

g1smd

10:05 pm on Feb 1, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The redirect or canonical tag is vital. All I was saying is that with the ID included and with it located at the beginning of the URL the code to run this is very much easier.

dirkules

10:22 pm on Feb 1, 2012 (gmt 0)

10+ Year Member



...SEO wise: is it not better to have the numbers in the url as far in the end as possible?

tedster

1:26 am on Feb 2, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The URL itself is a very minimal ranking factor today - more of a reinforcing signal than a deciding factor. I don't think it makes any significant difference these days.

enigma1

9:59 am on Feb 2, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The friendly links display with SERPs. Everything listed there is important for CTR and that includes links and keywords order. To detriment links with various identifiers is bad for SEO, it's less portable and exposes information you don't want to expose.

And it's a myth identifiers provide easy rewriting.

g1smd

12:56 pm on Feb 2, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



S'funny, 'cus I'm writing that code almost every day.

enigma1

1:01 pm on Feb 2, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'll be glad to have competitors using your code