Canonical URL for Home Page

Permalink Browser Info Environment
SEO Manager is creating a canonical tag with ".../index.php?cID=1".

Is that expected?

Is there a way to change it?

Thanks,

Marcus.

Type: Discussion
Status: New
mrowell
View Replies: View Best Answer
12345j replied on at Permalink Reply
12345j
hey,
there is a bug in the current version of c5 that is creating that. Fixing this bug is being discussed by several members of the community, however at this time there is no fix.
mrowell replied on at Permalink Reply
mrowell
12345j,

I changed line 13 of canonical.php to
if ($id == 1) {
         $v->addHeaderItem('<link rel="canonical" href="'.BASE_URL.'/" />');
      } else {
         $v->addHeaderItem('<link rel="canonical" href="'.$url.'" />');   
      }

Do you think that is ok? I don't know if the root/homepage of all concrete5 installations is id 1, but that works for us for the mean time.

Thanks for the follow-up,

Marcus
12345j replied on at Permalink Best Answer Reply
12345j
try using this
if ($id == HOME_CID) {
    $v->addHeaderItem('<link rel="canonical" href="'.BASE_URL.view::url('/').'" />');
} else {
    $v->addHeaderItem('<link rel="canonical" href="'.$url.'" />');   
}
which has a couple of advantages- HOME_CID will always be the id of the homepage, and view::url('/') will account for any subfolders that c5 might be in.
12345j replied on at Permalink Reply
12345j
btw, I have added the above code to seo manager for version 1.2.1 and above and hope to get it included in c5 by default.
mrowell replied on at Permalink Reply
mrowell
12345j,

Thanks for making that addition.

Marcus
mrowell replied on at Permalink Reply
mrowell
12345j,

You mentioned that you would included this addition into future releases of SEO Manager.

Could you confirm that is in version 2.2?

I am not seeing it there.

Thanks,
Marcus.
12345j replied on at Permalink Reply
12345j
not sure- i'll check.
12345j replied on at Permalink Reply
12345j
okay, my bad- ithad slipped out somehow. 2.2.1 fixes.
halki replied on at Permalink Reply
Canonical URL for Home Page I know this may not be related to my problem. The canonical url. I want my Blogger.com blog page to be directed from c5 to this page by inserting link on my blog page title on concrete 5. qso My Blog and click the link and forward to blogger ,com by inserting link into carnonical external page ????
12345j replied on at Permalink Reply
12345j
hi,
not sure if I really understood that but it seems like you want to redirect a blogger page to a concrete5 blog. If that is correct, then this is not a question to post in seo manager forums. you should instead look in the blogger help sectionhttp://www.google.com/support/blogger/?hl=en... or concrete5 forumshttp://www.concrete5.org/community/forums...

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.