Page 1 of 1

double canonical link

Posted: Tue Mar 17, 2015 8:14 pm
by giapippo
Hallo
i have 2 link in the html code for the same page
why ?

the page is this

http://www.gianlucacompagno.com/servizi ... mona-Crema



my template is

{strip}
{process_pagedata}
{* With cms_lang_info we retrieve current language information, assign gives us $nls variable we can work with *}
{cms_lang_info assign='nls'}

{* using strip as we don't want useless whitespace, especially not before doctype *}
{/strip}<!doctype html>
<__html lang='{$nls->htmlarea()}' dir='{$nls->direction()}'>
<head>

<title>{title} - {sitename}</title>
{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if}
{metadata}
{metaog}
<meta charset='{$nls->encoding()}'>

<meta name='viewport' content='initial-scale=1.0 maximum-scale=1.0 user-scalable=no' />
<meta name='HandheldFriendly' content='true' />

--------------------------------------

i need to delete the secondary wrong url

<link rel="canonical" href="http://www.gianlucacompagno.com/servizi ... mona-Crema" /><base href="http://www.gianlucacompagno.com/" />

if i delete the {metadata} tag, the wrong url disappears
but of course disappear also other information

where am I wrong?

thaks

Re: double canonical link

Posted: Tue Mar 17, 2015 9:07 pm
by velden
Nothing wrong with that.

Read about it:
http://www.w3schools.com/tags/tag_base.asp
http://docs.cmsmadesimple.org/tags/core/metadata-tag

Or do you mean that you have two <link rel="canonical" ...> tags:
Remove one of those. Either from the template itself or from the Global Metadata (Site Admin -> Global Settings)

Re: double canonical link

Posted: Tue Mar 17, 2015 9:35 pm
by giapippo
sorry but the base href="http://www.gianlucacompagno.com/" />
is correct ??

the correct link for the page is :

http://www.gianlucacompagno.com/servizi ... mona-Crema

after the domain name should not be the complete address of the page?


for exemple :

<base href="http://www.gianlucacompagno.com/servizi ... mona-Crema" />



p.s.
the Global Metadata are empty

Re: double canonical link

Posted: Tue Mar 17, 2015 9:37 pm
by velden
giapippo wrote:sorry but the base href="http://www.gianlucacompagno.com/" />
is correct ??

the correct link for the page is :

http://www.gianlucacompagno.com/servizi ... mona-Crema

after the domain name should not be the complete address of the page?


for exemple :

<base href="http://www.gianlucacompagno.com/servizi ... mona-Crema" />
Did you actually read the information I provided?

Re: double canonical link

Posted: Wed Mar 18, 2015 9:58 pm
by Dr.CSS
There aren't any duplicate URLs/canonical links in the page you linked, but you may want to clean the HTML...

http://validator.w3.org/check?verbose=1 ... mona-Crema

Re: double canonical link

Posted: Thu Mar 19, 2015 6:26 am
by Rolf
Base URL == Root URL
Canonical URL == Page URL