How do I change it so it's justmywebsite.com/index.php?route=account/account
I've googled and googled, downloaded extensions but nothing seems to work.mywebsite.com/account
Any help would be much appreciated.
How do I change it so it's justmywebsite.com/index.php?route=account/account
I've googled and googled, downloaded extensions but nothing seems to work.mywebsite.com/account
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Clear the browsing history and test it on the browser.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
You keep talking about the .htaccess file but you've misread the question.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Find an SEO extension for this.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Nevertheless. People can still use SEO and not enable the .htaccess file since the odds of people knowing that on first sight without using the forums are pretty low on anyhow.paulfeakins wrote: ↑Thu May 13, 2021 4:34 pmYou keep talking about the .htaccess file but you've misread the question.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
That seems to work but only on account/register and account/login - which I find strange.mikeinterserv wrote: ↑Thu May 13, 2021 1:34 amTake a look at this for another idea
https://webocreation.com/blog/remove-ro ... and-other/
Code: Select all
if ($data['route'] == 'information/sitemap'){
$url .= '/sitemap';
}
Which is really usefully generally as well as going forward rather than having to do and remember what you need to edit manually
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Code: Select all
function: rewrite
Code: Select all
foreach ($data as $key => $value) {
if (isset($data['route'])) {
if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id')) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
unset($data[$key]);
}
} elseif ($key == 'path') {
$categories = explode('_', $value);
foreach ($categories as $category) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = 'category_id=" . (int)$category . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
} else {
$url = '';
break;
}
}
unset($data[$key]);
}
}
}
Code: Select all
foreach ($data as $key => $value) {
if (isset($data['route'])) {
if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id')) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
unset($data[$key]);
}
} elseif ($key == 'path') {
$categories = explode('_', $value);
foreach ($categories as $category) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = 'category_id=" . (int)$category . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
} else {
$url = '';
break;
}
}
unset($data[$key]);
/**********************************************************************/
/* additional code enabling route seo urls and removing common/home from root url */
/**********************************************************************/
} elseif (!in_array($data['route'],array('common/language/language','common/currency/currency','product/product','product/category','product/manufacturer/info','information/information'))) {
// all other cases for route settings & eliminating unnecessary queries (seo urls already generates a truckload of queries for rewriting)
if ($key == 'route') {
// no need to query root
if ($value == 'common/home') {
$url = '/';
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . $this->config->get('config_language_id') . "'");
if ($query->num_rows) {
if ($url != '/') $url .= '/';
$url .= $query->row['keyword'];
unset($data[$key]);
}
}
}
}
}
}
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Users browsing this forum: niagato, Semrush [Bot], thomas_1989 and 645 guests