Post by kazihaha » Fri Oct 02, 2015 9:17 am

kazihaha wrote:
Johnathan wrote:IN:

Code: Select all

1.4.x: /catalog/model/tool/seo_url.php
1.5.x: /catalog/controller/common/seo_url.php
REPLACE THE FIRST INSTANCE OF:

Code: Select all

$url .= '/' . $query->row['keyword']; 
WITH:

Code: Select all

$url = '/' . $query->row['keyword']; 
If you want sub-categories to not show their parent categories in the URL, then replace both instances of that line with the replacement.

More tutorials are available at OpenCartX.com/tutorials
not work for my opencart 2.0.3.1, I still see
localhost/journal/may-photocopy/canon/canon-ir-2002n.html -> when I access "may-photocopy", then "canon", then "canon-ir-2002"
http://localhost/journal/canon-ir-2002n.html -> when I access this "canon-ir-2002n" from the home page.

Please help me.
Oh I figure it out today, there're 2 seo_url.php
1 - catalog\controller\common\seo_url.php
2 - system\modification\catalog\controller\common\seo_url.php

https://sieuthithietbivanphong.com


New member

Posts

Joined
Wed Sep 23, 2015 2:13 pm

Post by none » Fri Oct 07, 2016 5:27 pm

An update.
In Opencart 2.3 the seo_url.php file is in:

Code: Select all

/catalog/controller/startup
folder.

The code to be modified is in line 83 and 94.

New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by phamxuanvinh2110 » Mon Nov 28, 2016 12:53 pm

I done with seo_url.php with ver 2.0.3. It show short link (yourweb.com/product.link
But i want showing full link: parent cat/ sub cat/ product at feature product in homepage. How can i fix?
About SEO: Full link or short link (youeweb.com/product-link), which is good?

New member

Posts

Joined
Mon Nov 28, 2016 11:41 am

Post by RideTheWave » Tue Jun 27, 2017 5:11 pm

mmjy wrote:
Tue Jan 27, 2015 4:17 pm
I was wondering if this solution help SEO and rankings, and avoid duplicate content from search engines?
Just to let people know, the above fix works in OpenCart 2.3.0.2 (in catalog/controller/startup/seo_url.php). Without the fix, 2 different url's are being produced for the same product in Google sitemaps: 1) mydomain.com/category/subcategory/product.html and 2) mydomain.com/product.html

With the fix, only 1 url is produced, which happens to be the canonical url (mydomain.com/product.html) but it is being produced two times. Regarding duplicate content penalties, I'm assuming this is a lesser evil than having 2 DIFFERENT url's being produced for the same product. The reason why I'm assuming that is because of this article from Google: https://support.google.com/webmasters/answer/139066 which specifically says:
Don't specify different URLs as canonical for the same page (e.g. one URL in a sitemap and a different URL for that same page using rel="canonical").
So I guess it would probably be most ideal to have the Google sitemap create only 1 url for a product (obviously the canonical url).

New member

Posts

Joined
Fri May 19, 2017 8:29 am
Who is online

Users browsing this forum: No registered users and 16 guests