Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove index.php?route=common/home from OpenCart

Tags:

php

seo

opencart

I currently have User SEO URL's set to Yes in OpenCart Admin.

System -> Settings -> Store -> Server -> User SEO URL's

So far, all tags and SEO links are working; the command has done the desired effect.

However for the homepage and a few other links; how do I remove:

index.php?route=common/home

From the URL? Do I have to literally do a find and replace in the hardcode PHP files and risk upgrades or is there another way?

(without bloating performance i.e no poor amateur tools such as vQmod)

like image 420
TheBlackBenzKid Avatar asked May 30 '12 09:05

TheBlackBenzKid


1 Answers

To simply remove that, you can do a basic replace in /catalog/controller/common/seo_url.php

Find:

return $link; 

Before it on a new line put:

$link = str_replace('index.php?route=common/home', '', $link); 

Edit by TheBlackBenzKid: If you want full SEO just use this line instead of the above:

$link = str_replace('index.php?route=', '', $link); 

Also make sure SEO URLs is turned on in the Admin panel of the store.

like image 151
Jay Gilford Avatar answered Oct 09 '22 13:10

Jay Gilford