Page 1 of 1
Remove route=common/home?
Posted: Mon Jun 13, 2011 12:50 am
by alexmitev
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
Re: Remove route=common/home?
Posted: Mon Jun 13, 2011 3:44 am
by SXGuy
just alter the htacess file to rewrite index.php?route=common/home to just /
Re: Remove route=common/home?
Posted: Mon Jun 13, 2011 3:55 pm
by alexmitev
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?
Re: Remove route=common/home?
Posted: Mon Jun 13, 2011 6:04 pm
by uksitebuilder
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
Re: Remove route=common/home?
Posted: Fri Oct 25, 2013 4:42 am
by myshadowself
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):
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
Re: Remove route=common/home?
Posted: Fri Oct 25, 2013 7:16 pm
by MarketInSG
Re: Remove route=common/home?
Posted: Sat Oct 26, 2013 8:01 pm
by catney
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?