Post by alexmitev » Mon Jun 13, 2011 12:50 am

Hello,
I have a question, is it possible to remove the index.php?route=common/home part for all links referring to Home, so that http://site.com/index.php?route=common/home becomes just http://site.com/ ?
I think it's not good for SEO to have two home URLs with duplicate content

New member

Posts

Joined
Wed Jan 19, 2011 10:38 pm

Post by SXGuy » Mon Jun 13, 2011 3:44 am

just alter the htacess file to rewrite index.php?route=common/home to just /

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by alexmitev » Mon Jun 13, 2011 3:55 pm

I think won't stop Google from indexing the http://site.com/index.php?route=common/home page.
Maybe the better solution is to remove all these links in the controller:

Code: Select all

$this->document->breadcrumbs[] = array(
      		'href'      => HTTP_SERVER . 'index.php?route=common/home',
   		...	

Code: Select all

$this->document->breadcrumbs[] = array(
      		'href'      => HTTP_SERVER,
   		...	
I wonder, what was the reason to use the 1st variant and not the 2nd for all pages in the controller?

New member

Posts

Joined
Wed Jan 19, 2011 10:38 pm

Post by uksitebuilder » Mon Jun 13, 2011 6:04 pm

see this post for a better way of doing it and also making all the other index.php?route= urls more SEO friendly

http://forum.opencart.com/viewtopic.php ... 72#p164179

User avatar
Guru Member

Posts

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

Post by myshadowself » Fri Oct 25, 2013 4:42 am

Bit late to the party, but it seems there are loads of ways to do this.

If, like me, you like abit of hackery, you can put this hack into catalog > controller > common > seo_url.php (assuming V1.5.6)

find (near bottom):

Code: Select all

} else {
			return $link;
		}
replace with:

Code: Select all

} else {
			if(strpos($link,'index.php?route=common/home')){
				$link = str_replace('index.php?route=common/home','',$link);
			}
			return $link;
		}
Simple enough. I know it's hacking core files, but let's face it, we're not going to be upgrading a client's site anytime soon... and it works, everytime

Ronald Laughton is the worst referee in Rugby League


New member

Posts

Joined
Tue Jun 07, 2011 8:59 pm

User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by catney » Sat Oct 26, 2013 8:01 pm

Bit late to the party, but it seems there are loads of ways to do this.

If, like me, you like abit of hackery, you can put this hack into catalog > controller > common > seo_url.php (assuming V1.5.6)

find (near bottom):

Code: Select all
} else {
return $link;
}


replace with:

Code: Select all
} else {
if(strpos($link,'index.php?route=common/home')){
$link = str_replace('index.php?route=common/home','',$link);
}
return $link;
}



Simple enough. I know it's hacking core files, but let's face it, we're not going to be upgrading a client's site anytime soon... and it works, everytime
Worked a treat - is there a similar way for changing the file path names for account/checkout etc?

Newbie

Posts

Joined
Sat Oct 26, 2013 8:00 pm
Who is online

Users browsing this forum: No registered users and 51 guests