Explorar o código

#3504 Add canonical URL metatag to every possible page

RomanL %!s(int64=4) %!d(string=hai) anos
pai
achega
ac9d85adc3
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      inc/classes/BxDolTemplate.php

+ 3 - 1
inc/classes/BxDolTemplate.php

@@ -1192,12 +1192,14 @@ class BxDolTemplate extends BxDolFactory implements iBxDolSingleton
         $oFunctions = BxTemplFunctions::getInstance();
         $sRet .= $oFunctions->getManifests();
         $sRet .= $oFunctions->getMetaIcons();
-
+        
         if (!empty($this->aPage['rss']) && !empty($this->aPage['rss']['url']))
             $sRet .= '<link rel="alternate" type="application/rss+xml" title="' . bx_html_attribute($this->aPage['rss']['title'], BX_ESCAPE_STR_QUOTE) . '" href="' . $this->aPage['rss']['url'] . '" />';
 
         $sRet .= "<link rel=\"alternate\" type=\"application/json+oembed\" href=\"" . BX_DOL_URL_ROOT ."em.php?url=" . urlencode($_SERVER["REQUEST_URI"]) . "&format=json\" title=\"". (isset($this->aPage['header']) ? bx_html_attribute(strip_tags($this->aPage['header'])) : '') . "\" />";
         
+        $sRet .= "<link rel=\"canonical\" href=\"" . BX_DOL_URL_ROOT . substr($_SERVER["REQUEST_URI"], 1) . "\" />";
+        
         return $sRet;
     }
     /**