I found that most of the opencart catalog controllers are using 'index.php?route=' everywhere to construct url link. For example take a look at the CommonHeader contoller line 86:
Code: Select all
$this->data['home'] = HTTP_SERVER . 'index.php?route=common/home';
$this->data['special'] = HTTP_SERVER . 'index.php?route=product/special';
$this->data['contact'] = HTTP_SERVER . 'index.php?route=information/contact';
$this->data['sitemap'] = HTTP_SERVER . 'index.php?route=information/sitemap';
Currently i hack with the following code :
Code: Select all
//Config seo check, if seo then it wont display 'index.php?route=' else it shows normal 'index.php?route='.
if($this->config->get('config_seo_url')){
$index = '';
$extension = URL_EXTENSION; //custom config for page extension, such as .html if any. (global constanta)
}
else{
$index = 'index.php?route=';
$extension = '';
}
......... code ........
$this->data['special'] = HTTP_SERVER . $index . 'product/special' . $extension;
$this->data['contact'] = HTTP_SERVER . $index . 'information/contact' . $extension;
$this->data['sitemap'] = HTTP_SERVER . $index . 'information/sitemap' . $extension;
$this->data['account'] = HTTPS_SERVER . $index . 'account/account' . $extension;
It would be much simple if the seo check above is part of system controller, so we dont have to put that code in every controller. Since so many controller i should edit, everytime there's a new version of opencart, i should reedit the whole controller again after updating
