how to SEO the index.php?route=common/home
66 posts
• Page 3 of 4 • 1, 2, 3, 4
Re: how to SEO the index.php?route=common/home
Why not simply add it to the url_alias database table ?
In ours we have added this and also made many other pages SEO Friendly URLs
for home page:
INSERT INTO url_alias (query, keyword) VALUES ('common/home', '');
In ours we have added this and also made many other pages SEO Friendly URLs
for home page:
INSERT INTO url_alias (query, keyword) VALUES ('common/home', '');
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: how to SEO the index.php?route=common/home
uksitebuilder wrote:Why not simply add it to the url_alias database table ?
In ours we have added this and also made many other pages SEO Friendly URLs
for home page:
INSERT INTO url_alias (query, keyword) VALUES ('common/home', '');
Because that doesn't work. The code that processes the SEO URLs only accounts for products, categories, manufacturers, and information pages. You must have modified your seo_url.php files that database addition works for you.
-

Johnathan - Global Moderator
- Posts: 2955
- Joined: Thu Dec 17, 2009 7:08 pm
Re: how to SEO the index.php?route=common/home
Of course you are correct, I had a totally blank moment when I posted the above.
To solve, I have attached a rewritten catalog/controller/common/seo_url.php file
To solve, I have attached a rewritten catalog/controller/common/seo_url.php file
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: how to SEO the index.php?route=common/home
uksitebuilder wrote:Of course you are correct, I had a totally blank moment when I posted the above.
To solve, I have attached a rewritten catalog/controller/common/seo_url.php file
Yep, but in this file there is a line at the top of file:
- Code: Select all
$this->url->addRewrite($this);
which is returns fatal error, because there are no this method in standart OC code. What this method do and this is mandatory for good working SEO URL rewriting?
If you may - can you put here the file with this method & class.
Thx.
- tonic
- Posts: 1
- Joined: Tue Jul 12, 2011 10:22 am
Re: how to SEO the index.php?route=common/home
It's in system/library/url.php (OC 1.5.x)
See my mods below for a mod that does all the site Friendly SEO
See my mods below for a mod that does all the site Friendly SEO
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: how to SEO the index.php?route=common/home
i replaced the file but there is no changed ... why 

- yest
- Posts: 80
- Joined: Wed Aug 04, 2010 5:57 pm
Re: how to SEO the index.php?route=common/home
uksitebuilder wrote:Of course you are correct, I had a totally blank moment when I posted the above.
To solve, I have attached a rewritten catalog/controller/common/seo_url.php file
This works with v1.5.0.5 but not with v1.5.1
I've done it it in the phpmyadmin but the seo_url.php file seems to be different in 1.5.1
Whats the difference to apply ?
-

dony_b - Posts: 233
- Joined: Wed Aug 18, 2010 1:56 pm
- Location: Boston, MA
Re: how to SEO the index.php?route=common/home
It works fine in 1.5.1 I have it running on my demo store: http://www.designs.org.uk which is default OC 1.5.1.2
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: how to SEO the index.php?route=common/home
I get a blank page when I change the seo_url.php
why is this you think ?
why is this you think ?
-

dony_b - Posts: 233
- Joined: Wed Aug 18, 2010 1:56 pm
- Location: Boston, MA
Re: how to SEO the index.php?route=common/home
Usually means some kind of php fatal error or possibly whitespace being injected either before th opening php tag or after the closing php tag.
Do your error logs give an indication ?
If you have compression turned on in your admin settings, turn it off for a moment and it may display on screen what the actual error is.
Do your error logs give an indication ?
If you have compression turned on in your admin settings, turn it off for a moment and it may display on screen what the actual error is.
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: how to SEO the index.php?route=common/home
I tried that and checked the error log file from the admin and it doesn't show anything
Is there something else I can try ?
Is there something else I can try ?
-

dony_b - Posts: 233
- Joined: Wed Aug 18, 2010 1:56 pm
- Location: Boston, MA
Re: how to SEO the index.php?route=common/home
Below is the file :
- Code: Select all
<?php
class ControllerCommonSeoUrl extends Controller {
public function index() {
// Add rewrite to url class
if ($this->config->get('config_seo_url')) {
$this->url->addRewrite($this);
}
// Decode URL
if (isset($this->request->get['_route_'])) {
$parts = explode('/', $this->request->get['_route_']);
$route = "";
foreach ($parts as $part) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE keyword = '" . $this->db->escape($part) . "'");
if ($query->num_rows) {
$url = explode('=', $query->row['query']);
if(count($url) > 1){
if ($url[0] == 'product_id') {
$this->request->get['product_id'] = $url[1];
}
if ($url[0] == 'category_id') {
if (!isset($this->request->get['path'])) {
$this->request->get['path'] = $url[1];
} else {
$this->request->get['path'] .= '_' . $url[1];
}
}
if ($url[0] == 'manufacturer_id') {
$this->request->get['manufacturer_id'] = $url[1];
}
if ($url[0] == 'information_id') {
$this->request->get['information_id'] = $url[1];
}
}else{
$route = $url[0];
}
} else {
$this->request->get['route'] = 'error/not_found';
}
}
if (isset($this->request->get['product_id'])) {
$this->request->get['route'] = 'product/product';
} elseif (isset($this->request->get['path'])) {
$this->request->get['route'] = 'product/category';
} elseif (isset($this->request->get['manufacturer_id'])) {
$this->request->get['route'] = 'product/manufacturer/product';
} elseif (isset($this->request->get['information_id'])) {
$this->request->get['route'] = 'information/information';
}else {
$this->request->get['route'] = $route;
}
if (isset($this->request->get['route'])) {
return $this->forward($this->request->get['route']);
}
}
}
public function rewrite($link) {
if ($this->config->get('config_seo_url')) {
$url_data = parse_url(str_replace('&', '&', $link));
$url = '';
$data = array();
parse_str($url_data['query'], $data);
foreach ($data as $key => $value) {
if (($key == 'product_id') || ($key == 'manufacturer_id') || ($key == 'information_id')) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "'");
if ($query->num_rows) {
$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 . "url_alias WHERE `query` = 'category_id=" . (int)$category . "'");
if ($query->num_rows) {
$url .= '/' . $query->row['keyword'];
}
}
unset($data[$key]);
}elseif ($key == 'route') {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" . $this->db->escape($value) . "'");
if ($query->num_rows) {
$url .= '/' . $query->row['keyword'];
unset($data[$key]);
}
}
}
if ($url) {
unset($data['route']);
$query = '';
if ($data) {
foreach ($data as $key => $value) {
$query .= '&' . $key . '=' . $value;
}
if ($query) {
$query = '?' . trim($query, '&');
}
}
return $url_data['scheme'] . '://' . $url_data['host'] . (isset($url_data['port']) ? ':' . $url_data['port'] : '') . str_replace('/index.php', '', $url_data['path']) . $url . $query;
} else {
return $link;
}
} else {
return $link;
}
}
}
?>
-

dony_b - Posts: 233
- Joined: Wed Aug 18, 2010 1:56 pm
- Location: Boston, MA
Re: how to SEO the index.php?route=common/home
My goal for this is to only change the index.php?route=product/manufacturer to manufacturer if there is another way of doing this I open to that.
-

dony_b - Posts: 233
- Joined: Wed Aug 18, 2010 1:56 pm
- Location: Boston, MA
Re: how to SEO the index.php?route=common/home
Make sure your gzip compression is off in admin, then pop the following at the top of the index.php file just after the opening php tag
Hopefully it will now display on screen the error
- Code: Select all
error_reporting(E_ALL);
ini_set('display_error',1);
Hopefully it will now display on screen the error
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: how to SEO the index.php?route=common/home
dony_b wrote:My goal for this is to only change the index.php?route=product/manufacturer to manufacturer if there is another way of doing this I open to that.
Manually edit the link in your template footer file
Then in .htaccess add a redirect
- Code: Select all
RewriteRule ^manufacturer$ http://www.%{HTTP_HOST}/index.php?route=product/manufacturer [L]
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: how to SEO the index.php?route=common/home
uksitebuilder wrote:dony_b wrote:My goal for this is to only change the index.php?route=product/manufacturer to manufacturer if there is another way of doing this I open to that.
Manually edit the link in your template footer file
Then in .htaccess add a redirect
- Code: Select all
RewriteRule ^manufacturer$ http://www.%{HTTP_HOST}/index.php?route=product/manufacturer [L]
The only thing with that is that it doesn't change the URL structure but it only redirects it.
-

dony_b - Posts: 233
- Joined: Wed Aug 18, 2010 1:56 pm
- Location: Boston, MA
Re: how to SEO the index.php?route=common/home
that didnt work as it goes back to the homepage.
Your post I just saw a second ago got deleted
Your post I just saw a second ago got deleted

-

dony_b - Posts: 233
- Joined: Wed Aug 18, 2010 1:56 pm
- Location: Boston, MA
Re: how to SEO the index.php?route=common/home
I revert back to my earlier post, we need to see what this error is that is giving you a blank page
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
Re: how to SEO the index.php?route=common/home
What is exactly that you change in seo_url.php that makes it work ? Maybe I can try that one.
I removed the common/home occurrences by adding this code to seo_url.php
But cant seem to figured it out for manufacturers
I removed the common/home occurrences by adding this code to seo_url.php
- Code: Select all
$url || (isset($data['route']) && $data['route'] == 'common/home') ) {
But cant seem to figured it out for manufacturers
-

dony_b - Posts: 233
- Joined: Wed Aug 18, 2010 1:56 pm
- Location: Boston, MA
Re: how to SEO the index.php?route=common/home
here's a vqmod with the changes in it.
Happy Coding!
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
Simon
------
Commercial Mods:
Google Merchant / Base XML Feed + Bing Shopping + Sitemaps - Automatic Friendly SEO URLs
Full List of UKSB Extensions and Mods
vQmod Generator - Develop & Test OpenCart on your Local Windows machine
Click here if I have helped you and you would like to make a donation
-

uksitebuilder - Posts: 5602
- Joined: Thu Jun 09, 2011 3:37 pm
- Location: United Kindgom
66 posts
• Page 3 of 4 • 1, 2, 3, 4
Who is online
Users browsing this forum: anung, Bing [Bot], Cleo, kimcorcoran, MWB-02, raymondization, yeagerd and 49 guests























