jorge Villa Posted July 10, 2017 Share Posted July 10, 2017 Buenas, Tengo una web en 3 idiomas pero el canincal de cada home de cada una de ellas son iguales en vez de que salga con la coletilla de "es", "en" y "fr". Por ejemplo: En el idioma español la url es www.sublimet.com/es/ pero en el canonical me sale www.sublimet.com. Alguien sabe como modificar esto? Me está dando muchos problemas de indexación en google. Gracias,Saludos Link to comment Share on other sites More sharing options...
SergioE Posted July 10, 2017 Share Posted July 10, 2017 Hola, Que codigo usas para el canonical? Link to comment Share on other sites More sharing options...
jorge Villa Posted July 10, 2017 Author Share Posted July 10, 2017 Hola, Gracias por responder. El código es: <!-- canonical {$page_name} -->{if $page_name == 'index'} <link rel="canonical" href="{$base_dir}" /> <!-- h -->{elseif $page_name == 'category' or $page_name == 'best-sales' or $page_name == 'cart' or $page_name == 'discount' or $page_name == 'manufacturer' or $page_name == 'new-products' or $page_name == 'prices-drop' or $page_name == 'search'} <link rel="canonical" href="{$base_dir}{$request_uri|substr:1|regex_replace:'/\/(.*)/':''|regex_replace:'/\?(.*)/':''}" />{else} <link rel="canonical" href="{$base_dir}{$request_uri|substr:1}" /><!-- d -->{/if}<!-- /canonical -->*}<!-- canonical {$page_name}-->{if $page_name == 'category'} <link rel="canonical" href="{$link->getCategoryLink($smarty.get.id_category, null, $id_lang,null,null )}" /> {* {foreach $languages as $lang}<link rel="alternate" hreflang="{$lang.iso_code}" href="{$link->getCategoryLink($smarty.get.id_category, null, $lang.id_lang,null,null )}" />{/foreach} *}{/if} {if $page_name == 'product'} <link rel="canonical" href="{$link->getProductLink($smarty.get.id_product, null, null, null, $id_lang, null, 0, false)}" /> {* {foreach $languages as $lang}<link rel="alternate" hreflang="{$lang.iso_code}" href="{$link->getProductLink($smarty.get.id_product, null, null, null, $lang.id_lang, null, 0, false)}" />{/foreach} *}{/if}{if $page_name == 'index'} <link rel="canonical" href="{$base_dir}" /> {/if}{if $page_name == 'cms'} <link rel="canonical" href="{$link->getCMSLink($smarty.get.id_cms, null, false, $id_lang)}" /> {* {foreach $languages as $lang}<link rel="alternate" hreflang="{$lang.lang_iso}" href="{$link->getCMSLink($smarty.get.id_cms, null, false, $lang.id_lang)}" />{/foreach} *}{/if}{*{if $page_name == 'manufacturer'} <link rel="canonical" href="{$link->getManufacturerLink($smarty.get.id_manufacturer, null, null, null, $id_lang, null, 0, false)}" /> {foreach $languages as $lang}<link rel="alternate" hreflang="{$lang.iso_code}" href="{$link->getManufacturerLink($smarty.get.id_manufacturer, null, null, null, $lang.id_lang, null, 0, false)}" />{/foreach}{/if}*}<!-- /canonical --> Link to comment Share on other sites More sharing options...
SergioE Posted July 10, 2017 Share Posted July 10, 2017 Yo he usado el código que muestro en el post y me funciona, no lo he probado para idiomas, puesto que solo tengo 1. Prueba si quieres y me dices. https://www.prestashop.com/forums/topic/591231-etiqueta-canonical-header-tpl/ Link to comment Share on other sites More sharing options...
jorge Villa Posted July 10, 2017 Author Share Posted July 10, 2017 Buenas, Muchas gracias, me funciona perfectamente ese código Link to comment Share on other sites More sharing options...
SergioE Posted July 10, 2017 Share Posted July 10, 2017 Perfecto ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now