Author Topic: Google Canonical  (Read 12667 times)

0 Members and 1 Guest are viewing this topic.

Offline khansahib

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: Google Canonical
« Reply #15 on: July 16, 2011, 08:01:48 PM »
ah sorry i didn't mentioned that its in index.php

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: Google Canonical
« Reply #16 on: July 16, 2011, 08:07:43 PM »
ah sorry i didn't mentioned that its in index.php

ahhh ok, thanks!!

Offline wflorian

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Google Canonical
« Reply #17 on: May 29, 2012, 03:10:39 PM »
does not work with 4image install...

did anybody get this mod to work?

Offline sathishIPL

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Google Canonical
« Reply #18 on: May 30, 2012, 06:20:16 AM »
Hi ,

Check out this , it is working Mod

http://www.4homepages.de/forum/index.php?topic=17598.420

Best Regards,
Satz

Offline Geezer

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Google Canonical
« Reply #19 on: October 18, 2019, 07:14:50 AM »
it doesn't really work! Why? Is the code too old?

Here is how its done :).

open index.php file and find

Code: [Select]
include(ROOT_PATH.'includes/page_header.php');
Paste the following just before the above line.

Code: [Select]
if(isset($_GET['page'])) {
        $site_template->register_vars("google_con_url", '<link rel="canonical" href="' . ROOT_PATH . '/' . $_SERVER['REQUEST_URI'] . '" />');
}
else {
        $site_template->register_vars("google_con_url", '');
}


and insert

Code: [Select]
{google_con_url} in header of your template. Make sure its between <head> tags.

 

Post your comments here