Page 1 of 2

how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 3:25 am
by chongshengdz
how to remove ?limit=* ?search=* from product seo url?
for example:
https://example.com/seo-url?limit=25
https://example.com/seo-url?limit=50
https://example.com/seo-url?limit=75
https://example.com/seo-url?limit=100
https://example.com/seo-url?search=opencart
how to redirect and remove those parts (?limit=25,?limit=50,?limit=75,?limit=100,?search=opencart) from product seo url?
this is not google seo friendly, google webmaster will report it as duplicate contents.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 3:48 am
by letxobnav
Nothing to do with SEO url's, that is because the catalog controller adds the $url variable to the product urls which it should not.

Code: Select all

'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:05 am
by chongshengdz
letxobnav wrote:
Thu Dec 19, 2019 3:48 am
Nothing to do with SEO url's, that is because the catalog controller adds the $url variable to the product urls which it should not.

Code: Select all

'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
thank you for you quick reply.
but it is starting from line 162 on version 3.0.2.0
after removing those codes, the urls are still working.
better if you can do it via htaccess 301 redirection.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:12 am
by letxobnav
better if you can do it via htaccess 301 redirection.
That is a dumb idea.

line 206, just change

Code: Select all

'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
to

Code: Select all

'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] )

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:17 am
by thekrotek
Short version: you need to capture pairs like "limit=100" and turn it to "100" or "limit100" depending on your liking. Changes must be made in seo_url.php file to achieve this. .htaccess won't help you at all, not other modifications are necessary as well.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:25 am
by letxobnav
Nonsense, product url's should not have a limit, sort or order parameter.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:32 am
by thekrotek
letxobnav wrote:
Thu Dec 19, 2019 4:25 am
Nonsense, product url's should not have a limit, sort or order parameter.
These are not product URLs, but search URLs instead.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:35 am
by chongshengdz
letxobnav wrote:
Thu Dec 19, 2019 3:48 am
Nothing to do with SEO url's, that is because the catalog controller adds the $url variable to the product urls which it should not.

Code: Select all

'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
maybe you are using the older version of opencart.
the version 3.0.2.0 is already with ". $url".
so your solution is still not working.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:38 am
by chongshengdz
thekrotek wrote:
Thu Dec 19, 2019 4:32 am
letxobnav wrote:
Thu Dec 19, 2019 4:25 am
Nonsense, product url's should not have a limit, sort or order parameter.
These are not product URLs, but search URLs instead.
you can check your google webmaster center to see it under "Coverage > Alternate page with proper canonical tag".
i don't know why google have those urls.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:41 am
by chongshengdz

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:44 am
by thekrotek
Most likely these URLs are from search results. Don't see any other reason.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:47 am
by chongshengdz
thekrotek wrote:
Thu Dec 19, 2019 4:44 am
Most likely these URLs are from search results. Don't see any other reason.
yes, you are right.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 10:51 am
by letxobnav
the version 3.0.2.0 is already with ". $url".
so your solution is still not working.
yes, I said: remove the ". $url" part.

when in catalog view with display limit set or sort order set, the url's of the products copy those parameters over, they should not.

Then again, the canonical link on the product page itself is ok but that does not make the links ok.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 3:05 pm
by chongshengdz
letxobnav wrote:
Thu Dec 19, 2019 10:51 am
the version 3.0.2.0 is already with ". $url".
so your solution is still not working.
yes, I said: remove the ". $url" part.

when in catalog view with display limit set or sort order set, the url's of the products copy those parameters over, they should not.

Then again, the canonical link on the product page itself is ok but that does not make the links ok.
you are using an older opencart version.
please check 3.0+ and then reply.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 3:08 pm
by letxobnav
I am using V3 dumbass.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 4:02 pm
by xxvirusxx
chongshengdz wrote:
Thu Dec 19, 2019 3:05 pm
you are using an older opencart version.
please check 3.0+ and then reply.
Even Opencart 1.5.6.4 use that line....

And he tell you to delete $url, not to add.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 7:22 pm
by paulfeakins
letxobnav wrote:
Thu Dec 19, 2019 3:48 am
url's
"To start off, use all-caps for “URL” except of course in the case of jotting down notes, texting, or other casual communications. For web, print, and official correspondence, spell “url” with all caps = URL.

And when it comes to plural, or more than one URL, don’t use the apostrophe. More than one URL = URLs."

Source: https://www.daylaborproofing.com/urls-v ... -use-urls/

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 7:49 pm
by letxobnav
that is indeed a helpful addition to this topic.

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Thu Dec 19, 2019 7:52 pm
by paulfeakins
letxobnav wrote:
Thu Dec 19, 2019 7:49 pm
that is indeed a helpful addition to this topic.
Image

Re: how to remove ?limit=* ?search=* from product seo url

Posted: Wed Dec 25, 2019 9:06 pm
by cedcommerceteam
chongshengdz wrote:
Thu Dec 19, 2019 4:35 am
letxobnav wrote:
Thu Dec 19, 2019 3:48 am
Nothing to do with SEO url's, that is because the catalog controller adds the $url variable to the product urls which it should not.

Code: Select all

'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
maybe you are using the older version of opencart.
the version 3.0.2.0 is already with ". $url".
so your solution is still not working.
Hi,
If you have an eCommerce website, SEO is very important part of it. Website runners with even a little consideration to SEO approaches would agree that links and URLs are top specifiers of ranking on the SERPs. And SEO friendly URLs influence the ranking a lot. Following are the steps to change URLs -

1. Log into your OpenCart Admin panel.

2. Go to System>>Settings and click on the Server tab.

3. Here on this interface you will find “Use SEO URLs” option.

4. Select “Yes” option on the “Use SEO URLs” field.

5. Hover on the little question mark symbol in the blue circular background. It will display an info. Read it.

6. Login into your FTP access. Here I am using FileZilla for accessing my FTP.

7. Find the .htaccess.txt file and rename it to just .htaccess.

8. Log into your Admin panel and Go to “Catalog>>Products”.

9. Click Edit on any of the products whom you want to assign an SEO URL.

10. On the page that appears, Click on the “Data” tab.

11. Scroll down till you find SEO URL field.

12. Go to Catalog>>Categories

13. Click Edit button on any of the Categories from the Category list.

14. Click on Data tab and scroll down till you find the SEO URL field.

15. Customize it as you did for the products.

16. Go to Catalog>>Information

17. Click Edit button on any of the Pages from the list.

18. Click on Data tab and scroll down till you find the SEO URL field.

19. Customize it as you did for the products and Categories.