Answer the question
In order to leave comments, you need to log in
There are two Canonical tags in the HTML code of the dynamic page. Is it correct? Which tag will take precedence?
On the site cms joomla 3, in the jshopping component.
The product is in two categories.
In one category, a product has one rel="canonical" tag
<link rel="canonical" href="http://сайт/категория-1/maslo-1l">
<link rel="canonical" href="http://сайт/категория-2/maslo-1l">
<link rel="canonical" href="/категория-1/maslo-1l"/>
<!doctype html>
<html lang="ru-ru" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="canonical" href="http://домен.ru/raznoe/indijskoe-kastorovoe-maslo-1l">
<base href="http://домен.ru/raznoe/indijskoe-kastorovoe-maslo-1l" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta name="generator" content="Joomla! - Open Source Content Management" />
<title>ььььььь</title>
.....
....
....
<link rel="canonical" href="/razprodazha/indijskoe-kastorovoe-maslo-1l"/>
</head>
Answer the question
In order to leave comments, you need to log in
On a page that has two "canonical" tags, which of the two tags takes precedence, top or bottom?According to the logic of HTML'a, the tag that is declared last will have priority (it must override all previous ones). But, since these tags are intended primarily for bots - there is an opinion that different bots can behave differently, primarily because according to the rules (if my memory serves me right) - "rel canonical" is indicated exactly in
and is it correct at all when there are two canonical tags on the page
<head/>
, therefore, there is a suspicion that bots in some cases can ignore the "lower" tag, and in some cases ignore the fact that the tag violates the rules and redefine the value ... <head/>
, with a higher probability (according to the rules of HTML) the second one will work.
You don't have an autoload file, I suspect. Well, you can either include all the classes manually (good luck) or install the dependency via composer:
Use a dependency manager for your projects. In the repository you listed in the instructions, composer is actually the only suggested installation method.
More info:
php.net/manual/en/language.oop5.autoload.php
https://getcomposer.org/doc/00-intro.md
Regarding autoload (instead of Composer):
function myAutoload ($class) {
$class=str_replace("\\",DIRECTORY_SEPARATOR,$class);
include($_SERVER['DOCUMENT_ROOT']."/" . $class . ".php");
}
if (!empty($client)) {
foreach($client->_classmap as $class){
spl_autoload_register("myAutoload");
}
}
//$client - класс, в котором есть зависимости
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question