aMJay
aMJay

Reputation: 2243

Change structure of automaticly generated urls in prestashop

I have this website of my client made by someone in prestashop which has search input, and after searching for an item it will display a list of matching products, each linking to its page with a url looking like this:

www.website.com/category/full-product-name.html?search_query=search_phrase&results=2

Where a regular url of the product page looks like this:

www.website.com/category/full-product-name.html

The problem is now the google indexes the duplicated urls as separate pages.

I've never worked with prestashop before but I've looked into the template files and found something what I'd assume is file responsible for generating the content with line responsible for the link looking like this:

<a class="product_img_link" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">

Now as I don't know much about prestashop I don't want to blindly change stuff. How could I change it to have the links from the search results have the same structure as the normal product page urls?

Upvotes: 0

Views: 152

Answers (1)

TheDrot
TheDrot

Reputation: 4337

Well I don't know what's the point of allowing search engines indexing search pages but the problem is here. For whatever reason the developers decided to include query string into search result links.

You can create an override of search controller (or custom search module would be even better) and throw that line out and you should have normal product links.

Upvotes: 1

Related Questions