Jump to content

Error Urls canonical - % - prestashop 1.6


printbag.es
 Share

Recommended Posts

Hola, 

 

Buenos dias. 

 

A ver si me podeis por fis echar una mano con esto. 

 

He configurado la url canonical y me da un error 404 en todas las paginas. 

he mirado y en la url canonical me sale asi 

 

http://printbag.es/%20bolsas-de-tela

 

abajo os añado lo que he puesto en la  cabecera del head. 

 

importante: uso un modulo para quitar los id que se llama SEO Pretty URL - no se si venga por ahi el error. 

 

codigo. 

 

<!-- canonical -->
{if $page_name == 'index' or $page_name == 'search'}
<link rel="canonical" href="{$base_dir}" />
{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'}
<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}" />
{/if}
<!-- /canonical -->
 
gracias de antemano. 
Edited by printbag.es (see edit history)

Share this post


Link to post
Share on other sites

  • 2 weeks later...

Hola, Si queires prueba con este...
Este lo manejo yo en algunas tiendas, es diferente al que tienes ahora mismo (y creo que agrega lo del HTTPS)

<!-- canonical -->
    {if $page_name == 'index' or $page_name == 'search'}
      <link rel="canonical" href="{$base_dir_ssl}" />
    {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'}
      <link rel="canonical" href="{$base_dir_ssl}{$request_uri|substr:1|regex_replace:'/\/(.*)/':''|regex_replace:'/\?(.*)/':''}" />
    {else}
      <link rel="canonical" href="{$base_dir_ssl}{$request_uri|substr:1}" />
    {/if}
<!-- /canonical -->

Share this post


Link to post
Share on other sites

  • 1 month later...

 

Hola, Si queires prueba con este...

Este lo manejo yo en algunas tiendas, es diferente al que tienes ahora mismo (y creo que agrega lo del HTTPS)

<!-- canonical -->
    {if $page_name == 'index' or $page_name == 'search'}
      <link rel="canonical" href="{$base_dir_ssl}" />
    {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'}
      <link rel="canonical" href="{$base_dir_ssl}{$request_uri|substr:1|regex_replace:'/\/(.*)/':''|regex_replace:'/\?(.*)/':''}" />
    {else}
      <link rel="canonical" href="{$base_dir_ssl}{$request_uri|substr:1}" />
    {/if}
<!-- /canonical -->

Hola muchas gracias por tu respuesta, he cambiado el codigo y parece ser que ha funcionado, esperare a ver si funciona del todo bien y pongo el tema como solucionado, mil gracias por tu ayuda 

  • Like 1

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More