Mobile app version of vmapp.org
Login or Join
Murray155

: Why do sites redirect to the canonical URL if it can parse a page correctly given any slug? Several sites that I have come across, including Stackoverflow, perform a 301 redirect when given

@Murray155

Posted in: #301Redirect #CanonicalUrl #Seo

Several sites that I have come across, including Stackoverflow, perform a 301 redirect when given an "incorrect" slug. For example:
webmasters.stackexchange.com/questions/9/incorrect-slug

will be redirected permanently to:
webmasters.stackexchange.com/questions/9/who-is-a-great-domain-registrar-company

But since assuming that the canonical URL is already specified, wouldn't the search engine point to the correct URL? What is the rationale for doing a redirect if the a page does not require the slug to parse correctly?

Further, is it a prerequisite to have at least a link pointing to the canonical URL in order for the page to be ranked? Will Google add search result to the canonical URL mysite.com/user/1/joe if all my links point to mysite.com/user/1?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray155

2 Comments

Sorted by latest first Latest Oldest Best

 

@Voss4911412

Several sites that I have come across, including Stackoverflow, perform a 301 redirect when given an "incorrect" slug.


The web server for those sites is configured to redirect to a "catch-all" URL should a portion of the URL be missing. In the example you provided:
webmasters.stackexchange.com/questions/9/incorrect-slug

If anything after the 9/ is added, it will redirect to:
webmasters.stackexchange.com/questions/9/who-is-a-great-domain-registrar-company



But assuming that the canonical URL is already specified, wouldn't the search engine point to the correct URL?


Canonical URLs are for indicating the preferred URL to index. In the case of redirecting an incomplete, non-existing URL to an existing one, canonical URLs are not really a factor - only the target page of the redirect will be seen.


What is the rationale for doing a redirect if the a page does not require the slug to parse correctly?


One reason for redirecting a non-existent URL to an existing URL is to keep the visitor on the site by showing a popular page (or question in this case) instead of an error page, which may lead to lower bounce rates.


Further, is it a prerequisite to have at least a link pointing to the canonical URL in order for the page to be ranked?


A canonical link is a link, so providing Google finds the canonical link somewhere, it may index it, depending on the criteria of its algorithm.

10% popularity Vote Up Vote Down


 

@Kevin317

As you know, in Stack Exchange, edits can be made to the title. By this reason, for a single question, there can be generated as many URLs as titles had the question. Those older edited titles generate obsolete URLs that shouldn't exist and should 301 redirect to the fresh updated one.

301 redirect is better than rel="canonical", because you're avoiding Google from indexing crawling infinite pages (as you have infinite possible slugs) with the same content, all of them pointing to the same canonical.

rel="canonical" is better used for URLs that should exist, like URLs with parameters that generate the same content between them (i.e. in-site searches, URLs with tracking parameters), but that should not be redirected.

About your last two questions, in your case rel="canonical" will work fine because all generated links point to pages with the exact same content and Google finds it easy to associate them and not index the duplicated ones.

But you can't tell a search engine to "point" to the URL that you consider the best, Google may index both the canonical and the non-canonical if it considers that good for SERPs.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme