Post by DragonJ » Thu Mar 22, 2012 4:37 am

Google has updated my site's homepage URL in their index as...

example,com/index.php?route=common/home <--VERY BAD

What is the fix for this? Has anyone created code for a canonical tag for the home page? I searched, but couldn't find anything.

My store is awesomely powered by OpenCart 1.5.5.1.


User avatar
Active Member

Posts

Joined
Sun Jan 29, 2012 4:49 pm

Post by uksitebuilder » Sat Mar 24, 2012 3:12 am

edit: catalog/controller/common/home.php

after

Code: Select all

		$this->document->setDescription($this->config->get('config_meta_description'));
add

Code: Select all

		$this->document->addLink('http://www.yourdomain.com', 'canonical');

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by DragonJ » Sun Mar 25, 2012 1:58 am

Thank you, kindly. This works. :D

My store is awesomely powered by OpenCart 1.5.5.1.


User avatar
Active Member

Posts

Joined
Sun Jan 29, 2012 4:49 pm

Post by amit_sr » Tue May 29, 2012 1:10 am

thanks that really helped....

Cool Bean Bags India
Bean Bags Online


Newbie

Posts

Joined
Tue May 29, 2012 12:56 am
Location - Pune

Post by lankanspirit » Wed Jul 18, 2012 1:59 pm

Thanks a lot. That was really useful .

Send gift to Sri Lanka


Newbie

Posts

Joined
Wed Jul 18, 2012 1:41 pm

Post by G47F » Tue May 13, 2014 7:48 am

uksitebuilder wrote:edit: catalog/controller/common/home.php

after

Code: Select all

		$this->document->setDescription($this->config->get('config_meta_description'));
add

Code: Select all

		$this->document->addLink('http://www.yourdomain.com', 'canonical');
Hi uksitebuilder,

Would it be possible to get the above code working on a multi-store setup?

Thanks

New member

Posts

Joined
Sat Feb 08, 2014 6:51 am

Post by JAY6390 » Tue May 13, 2014 7:50 am

G47F - That can be done quite simply by changing

Code: Select all

$this->document->addLink('http://www.yourdomain.com', 'canonical');
to

Code: Select all

$this->document->addLink($this->config->get('config_url'), 'canonical');

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by G47F » Tue May 13, 2014 7:56 am

JAY6390 wrote:G47F - That can be done quite simply by changing

Code: Select all

$this->document->addLink('http://www.yourdomain.com', 'canonical');
to

Code: Select all

$this->document->addLink($this->config->get('config_url'), 'canonical');
Works perfectly, thanks Jay :)

New member

Posts

Joined
Sat Feb 08, 2014 6:51 am

Post by JPC60 » Sun Sep 11, 2016 3:40 pm

This really is the soultion I'm looking for, but on OC 1.5.1.3 altering this php file didn't work. Could it be that my OC install is in a WordPress subfolder? I wouldn't have thought so, but I'm not sure.

Any help would be appreciated. Thanks.

John

New member

Posts

Joined
Thu Nov 17, 2011 5:42 am

Post by tseflikas » Tue Jan 30, 2024 10:35 pm

hello what about opencart4 ?is this compatible ?

Newbie

Posts

Joined
Mon Jan 29, 2024 7:30 pm
Who is online

Users browsing this forum: No registered users and 16 guests