Frage

I can use the bit.ly for shorten url in canonical? In terms of seo, right?

for example :

<link rel="canonical" href="<?php echo $post->og('bitly'); ?>" />

and

<meta property="og:url" content="<?php echo $post->og('bitly'); ?>" />

or

<link rel="canonical" href="<?php echo $post->og('url'); ?>" />


url : http://domain/post/title

bitly: http://bit.ly/3tcJjx

Which is correct?

Thank

War es hilfreich?

Lösung

You cannot set the canonical URL to a shortened URL or any URL that redirects.

In many ways, Google sees a canonical as equivalent to a redirect. When you specify a canonical URL, it tells Googlebot, "Don't index the content on this URL, go here and index the content here instead." Then when Google gets to bit.ly, it finds that it redirects back and heads right back. The logic is that of an infinite redirect.

Your canonical URL must be a URL that actually contains the content. It cannot be a URL that redirects to the content.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top