double canonical link

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

double canonical link

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: double canonical link

Post 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)
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: double canonical link

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: double canonical link

Post 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?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: double canonical link

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: double canonical link

Post by Rolf »

Base URL == Root URL
Canonical URL == Page URL
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”