Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have seen many websites using slugs in their URL to boost SEO such as this:

http://example.com/article/1543/how-to-boost-seo/

I was thinking if I could do something like this instead:

http://example.com/article/1543#how-to-boost-seo

and specify it as the canonical URL. This article from Google says, "It's a hint that we honor strongly." Does that include the fragment identifier, or would it be discarded?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Fragment identifiers are traditionally used to identify a portion of document for client-side applications. As stated in the specification Google adopted:

Traditionally, hash fragments (that is, everything after # in the URL) have been used to indicate one portion of a static HTML document. ...hash fragments are not part of HTTP requests (and as a result they are not sent to the server)

Consequently as this covers, the Googlebot ignores hash fragments by default. Therefore for this URL:

http://example.com/article/1543#how-to-boost-seo

Googlebot should just look at the resource returned by the server: http://example.com/article/1543 while ignoring the hash fragment: how-to-boost-seo.

So essentially the resource for the above URL is the canonical URL after normalization (i.e., removing the fragment).

The purpose of using a slug is to identify a page as a human-readable keyword. Using a fragment confuses this purpose and obscures its readability:

/how-to-boost-seo is a lot more readable than: /1543#how-to-boost-seo

So in short, using a fragment as a slug would not seem beneficial to users or search engines.

share|improve this answer
    
Thanks for the info. I read the specification, but the wording just isn't quite clear. It is like trying to infer what Google will index based on a document meant for AJAX crawling. Readability can be improved by adding a / like this /1543#/how-to-boost-seo. –  Question Overflow Aug 29 '13 at 8:26
    
Take a look the last section (number 6) of the third link in my answer here. Google ignore everything after the hash, regardless of a slash after it, because it needs to normalize URLs to prevent duplicate content. If you need to use a hash in a URL, you'll need to use a hash bang #! as covered in their specification. –  dan Aug 29 '13 at 8:45
    
I found this which suggest that Google do index hashes to provide "jump to" links within a search result. It is now clearer, at least to me, that hash fragment may not be used in the main result. –  Question Overflow Aug 30 '13 at 9:08
    
Yep, that's for rich snippets. Most search engines are the same, otherwise one page with many anchors links on it would result in the same page being indexed multiple times, resulting in duplicate content. –  dan Aug 30 '13 at 22:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.