Questions tagged [canonical-link]

is a keyword for the HTML attribute `rel` which allows specification of the preferred URL for web pages with duplicate content.

canonical is a HTML rel keyword to prevent duplicate content issues by specifying the preferred ("canonical") version of a web page URL. It is supported by Google, Yahoo, Bing and other search engines. It is described in RFC 6596.

408 questions
155
votes
8 answers

How can I have lowercase routes in ASP.NET MVC?

How can I have lowercase, plus underscore if possible, routes in ASP.NET MVC? So that I would have /dinners/details/2 call DinnersController.Details(2) and, if possible, /dinners/more_details/2 call DinnersController.MoreDetails(2)? All this while…
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
67
votes
7 answers

Do canonical links require a full domain?

I want to add canonical links to my pages, but do I need to specify the domain, or will a relative URL do? In other words, is: good enough, or do I need to use:
Richard
  • 31,629
  • 29
  • 108
  • 145
27
votes
4 answers

Difference between rel="canonical" and og:url?

I'm having trouble understanding canonical URLs with regards to how search engines and Facebook seem to handle them. My Google maps powered site allows visitors to use social media to request a gig in their country. One of the pages in question can…
Will
  • 309
  • 1
  • 4
  • 10
21
votes
3 answers

Canonical URL in Analytics

As far as I know, canonical URLs are only recognized by search engines - a way to ensure that when a search engine crawls your page, no matter which URL got it there, all of the "link juice" points to one canonical URL. So on a DNN site when…
David Grenier
  • 1,221
  • 1
  • 10
  • 23
16
votes
5 answers

how to add canonical link in angular 5

How to add canonical link in angular 5 dynamically
sai kiran
  • 557
  • 2
  • 5
  • 16
14
votes
2 answers

Twig - Get URL for canonical tag

I'm looking to create a dynamic rel="canonical" tag in my application which pulls in the current URL but want to ensure any query parameters are removed. E.g http://www.example.com/test/?page=2 should have the canonical as…
user1961082
  • 1,015
  • 17
  • 41
13
votes
3 answers

How do I get the final, redirected, canonical URL of a website using PHP?

In the days of link shorteners and Ajax, there can be many links that ultimately point to the same content. I was wondering what the best way is to get the final, best link for a web site in PHP, hopefully with a library. I was unable to find…
Matt
  • 910
  • 7
  • 21
12
votes
3 answers

How to correctly canonicalize a URL in an ASP.NET MVC application?

I'm trying to find a good general purpose way to canonicalize urls in an ASP.NET MVC 2 application. Here's what I've come up with so far: // Using an authorization filter because it is executed earlier than other filters public class…
Bennor McCarthy
  • 11,415
  • 1
  • 49
  • 51
12
votes
5 answers

Canonical url and localization

In my application I have localized urls that look something like this: http://examle.com/en/animals/elephant http://examle.com/nl/dieren/olifant http://examle.com/de/tiere/elefant This question is mainly for Facebook Likes, but I guess I will hit…
Dirk Boer
  • 8,522
  • 13
  • 63
  • 111
10
votes
1 answer

Open Graph - Fetched and Canonical URL in a Posted Action

We are currently testing the Facebook functionality of our desktop application. We defined a Facebook app, then created open graph actions, objects and aggregations. First question: in case the fetched (the object URL) and canonical (og:url) URLs…
Takeo Sato
  • 161
  • 5
10
votes
1 answer

What are canonical URLs and how do they affect your SEO?

I've heard people mention the Canonical URL tag, but I don't know what it means or what its purpose is. What is it and how does it affect SEO?
Gotube
9
votes
5 answers

CakePHP Canonical Tag with html helper

How can I create this using the html helper? (with inline=false so i can specify it on a per-view basis) Can't seem to find anything on this, apart from a patch…
Chris J Allen
  • 18,970
  • 20
  • 76
  • 114
9
votes
1 answer

Link rel="canonical": Should different user guide versions use the same canonical url?

Should 2 different versions of a user guide use a different canonical URL? Documentation version 1.1.0.Final: Documentation version 1.2.0.Final:
Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
9
votes
3 answers

Yii 2 canonical URL in urlManager configuration

I've got urlManager section in app configuration with several URLs per route: 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => true, 'rules' => [ …
Estus Flask
  • 206,104
  • 70
  • 425
  • 565
8
votes
2 answers

Magento product export with full canonical url

Is there a way to get a list of products with their current canonical url on command line? class Mage_Shell_UrlTest extends Mage_Shell_Abstract { public function run() { $productCollection = Mage::getResourceModel('catalog/product_collection') …
Kevin
  • 1,232
  • 10
  • 28
1
2 3
27 28